Re: [R] Graphic Device - View/get all graphics

2009-11-27 Thread MarcioRibeiro
ocedure, but I dont know how I save an object that is a graphic... Listers, I just want some advices in order to make a research about what functions of R I could save the graphics in my function... Thanks again, Marcio MarcioRibeiro wrote: > > Hi Listers, > I am producing some grap

[R] Graphic Device - View/get all graphics

2009-11-24 Thread MarcioRibeiro
Hi Listers, I am producing some graphics that the commands are in a FUNCTION... The problem is that I end up viewing just last graphic and in my FUNCTION there are 4 graphics with the PAR command function... Like those below... How do I view/get the other 3 graphics? Any help? Thanks in advance...

[R] Sum according observation

2009-09-18 Thread MarcioRibeiro
Hi listers, I have a simple doubt... I need to manipulate the data base as: var1 var2 7 0.1 7 0.1 8 0.12 100.15 120.18 200.31 I would like to aggregate the equal cases as var1 making the sum of var2... I would get... var1 var2 7 0.2 8 0.12 100.15 120

[R] Program with indicatrix function

2009-09-17 Thread MarcioRibeiro
Hi listers, First I programmed the calcul of a empirical distribution function given by: F_hat(y)=(1/n)*Sum[Ind(yi<=y)] I checked the ecdf function and I found out how does it works... A modification of the function would be: n<-6 x<-c(10,12,7,7,5,4) vals<-unique(x) edf<-cumsum(tabulate(match(x,

[R] Bootstrap simulation

2009-09-10 Thread MarcioRibeiro
Hi listers, I would like a suggestion. I am working on a bootstrap simulation which I am calculation the confidence intervals to obtain the coverage probability. I am applying 3 kind of confidence intervals and 3 coverage probabilities (2 sided, left 5% and left 95%). I programmed a function for t

[R] Simulation function

2009-08-18 Thread MarcioRibeiro
Hi listers, I've been looking for a procedure, but I am not succeding... I have a function that give multiple results... Then, I would like to simulate this function n times, so I need to save/keep the n multiple results, in order to calculate my desired statistics... I have already tried with the

Re: [R] Simulation Function - Save results

2009-08-18 Thread MarcioRibeiro
this list. > > e.g. > > #Function A > boot<-function(a,b,c){ > mean_boot<-(a+b)/2 > var_boot<-c > > list(mean_boot = mean_boot, var_boot = var_boot) > } > > out <- boot(1,2,3) > out > $mean_boot > [1] 1.5 > > $var_boot > [1] 3 >

[R] Simulation Function - Save results

2009-08-14 Thread MarcioRibeiro
Hi listers, I am working on a simulation... But I am having some troubles... Suppose I have a function A which produces two results (mean and variance)... Then I would like to simulate this function A with a function B many times using the results from function A For example: #Function A boot<-fu

[R] Merge vectors

2009-07-22 Thread MarcioRibeiro
Hi listers, I would like to merge two vectors as follows... A<-c(3,5,7,18,43,85,91,98,100,130,230,487) #data values B<-c(10,5,5,10,8,11,2,7,3,11,10) #random numbers (sample) I would like to set the vector of random numbers according to the order set of the vector of data values... The result woul

[R] Select value according two vectors...

2009-07-21 Thread MarcioRibeiro
Hi listers, I have a problem in identifying a value between two vectors... Suppose vector A is... 0. 0.0909 0.0909 0.1818 0.2727 0.3636 0.4545 0.6363 0. 0. 0. 0. And vector B is... 3 5 7 18 43 85 91 98 100 130 230 487 I would like to identify the value of vector B that

[R] Sample Function

2009-07-16 Thread MarcioRibeiro
Hi listers, Suppose I have a dataset with n=10 observations and I want to sample with replacement. My new sample is of size m=9. So, I am using the following code... newsample<-dataset[sample(m,replace=T),] The problem is that generates the new sample and the last observation of my data set is nev

[R] Sample Function

2009-07-16 Thread MarcioRibeiro
Hi listers, I am -- View this message in context: http://www.nabble.com/Sample-Function-tp24519071p24519071.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

[R] Order data frame

2009-06-12 Thread MarcioRibeiro
Hi listers, I have a data frame with 5 variables... And I want reorder the data frame according a specific variable X... I checked the sort and order functions... In my case I think that the ORDER function is applicable... But I did not understand at all... The idea is simple... Data order by X...

Re: [R] Count observation

2009-06-11 Thread MarcioRibeiro
e(table(boot)) > ? > > milton > brazil=toronto > On Thu, Jun 11, 2009 at 3:13 PM, MarcioRibeiro wrote: > >> >> Hi listers, >> I have the following code... >> >> data<-as.matrix(c(1,2,3,4,5,6,7,8,9,10),nrow=10,ncol=1,byrow=TRUE) >> n<-nrow(data) >

[R] Count observation

2009-06-11 Thread MarcioRibeiro
Hi listers, I have the following code... data<-as.matrix(c(1,2,3,4,5,6,7,8,9,10),nrow=10,ncol=1,byrow=TRUE) n<-nrow(data) m<-n-1 boot<-data[sample(m,replace=T),] So, I need to count the number of times each observation was selected at the sample with replacement... Suppose I sampled... 4 5 1 3 7

[R] Discriminant Analysis Ellipse

2009-04-10 Thread MarcioRibeiro
Hi listers, I am working on a program in order to create an ellipse as a limit of my observations there are well classified. I have two independent variables for an quadratic discriminant function between 2 groups where my mean is zero and my covariance matrix is proportional. Q=y'Ay+c My program

[R] Discriminant analysis - posterior prob

2009-04-04 Thread MarcioRibeiro
Hi listers, I have a statistical question corcerning the posteriori probability of a discriminant analysis. I am calculating the probabilities under R using the formula. posteriori_j=exp(q_j(y))/sum(q_j(y)) qj(y) is my quadratic discriminant function for the case where my covariance matrix are pro

Re: [R] Matrix multiplication - code problem

2009-04-02 Thread MarcioRibeiro
arcio Uwe Ligges-3 wrote: > > > > MarcioRibeiro wrote: >> Hi listers, >> I am having some trouble in a matrix multiplication... >> I have already checked some posts, but I didn't find my problem... >> I have the following code... >> But I am not

Re: [R] Matrix multiplication - code problem

2009-04-01 Thread MarcioRibeiro
ay2 <- array(1:20,dim=c(2,2,5)) result <- array(dim=c(dim(array1)[1], dim(array2)[2], dim(array1)[3])) for (i in 1: dim(array1)[3]){ result[,,i] <- array1[,,i]%*%array2[,,i] } Thanks... Ben Bolker wrote: > > > > MarcioRibeiro wrote: >> >> Hi listers, >

[R] Matrix multiplication - code problem

2009-04-01 Thread MarcioRibeiro
Hi listers, I am having some trouble in a matrix multiplication... I have already checked some posts, but I didn't find my problem... I have the following code... But I am not getting the right multiplication... I checked the dimension and they are fine... id_y <- array(1:10,dim=c(2,1,5)) id_yt<-

[R] Package candisc

2009-03-31 Thread MarcioRibeiro
Hi listers, I am working on an canonical discriminant analysis, but I am having some trouble to use the CANDISC function... I just installed the last R version and installed the package CANDISC... But, I am getting the following message because about a permission: The downloaded packages are in C

[R] Quadratic Discriminant Analysis (qda)

2009-03-27 Thread MarcioRibeiro
Hi listers, Does anybody knows if the function qda for quadratic discriminant analysis provides the coefficients of quadratic discriminants... Well, I find out that for the linear discriminant analysis lda, the fonction provides the coefficients... Thanks in advance, Marcio -- View this message

[R] Data manipulation - multiplicate cases

2009-03-27 Thread MarcioRibeiro
Hi listers, I am trying to arrange my data and I didn't find any information how to do it! I have a data with 3 variables: X Y Z 1-I would like to multiplicate de information of X according to the number I have for my Y variable... 2-Then I want to identify with a dicotomic variable by the number

[R] Hotteling Test

2009-03-24 Thread MarcioRibeiro
Hi listers, I would like to do a graphic of the power function of the Hotteling test (T2). T2~F(p,n-p;lambda), lambda is my paremeter of non-centrality. So I would like to do a graphic of the power of the test as a function of the parameter lambda. I also would like to define lambda varying betwee

[R] Distribution U

2009-03-17 Thread MarcioRibeiro
Hi listers, Does anybody could tell me if there is a function for the DISTRIBUTION FUNCTION U(p;m,n)! Thanks, Marcio -- View this message in context: http://www.nabble.com/Distribution-U-tp22567871p22567871.html Sent from the R help mailing list archive at Nabble.com. __

[R] While with 2 conditions

2009-02-27 Thread MarcioRibeiro
Hi listers, I check it out at the messages... But I didn't find how do I use the while with 2 conditions... while (a>1 ? b>1){ a<-2 b<-2 } Should I use what... Thanks in advance, Marcio -- View this message in context: http://www.nabble.com/While-with-2-conditions-tp22252945p22252945.html S

[R] Transpose array

2009-02-24 Thread MarcioRibeiro
Hi Listers, Is there a way that I can transpose an array... Suppose I have the following array... x<-array(c(1,2,3,4),dim=c(1,2,2)) , , 1 [,1] [,2] [1,]12 , , 2 [,1] [,2] [1,]34 And I would like to get the following result... , , 1 [,1] [1,]1 [,2]2 , , 2

[R] Matrix multiplication multivariate

2009-02-20 Thread MarcioRibeiro
Hi listers... I am trying to do a matrix multiplication... Suppose my data has 100 obs and 2 variables... I calculated the estimateurs of location and dispersion... So now I would like to do the following... t(Xi-location)%*%solve(dispersion)%*%(Xi-location) My code is... Z<-rep(2,200) Z<-matrix(Z

[R] ML estimators of bivariate cauchy

2009-02-20 Thread MarcioRibeiro
Hi all, I am using the function COV.WT to estimate the estimators (location and scale) of a bivariate cauchy distribution. My doubt is about the option WT (weight), cause at the R-help shows that the weight is uniform according to the number of observations. But, checking the theory, for example,