Re: [R] means and variances of several groups in the matrix

2008-04-24 Thread Julian Burgos
Hy Katie, There are many ways to do this. A simple one is to create a vector of the same length than your 'x' vector, containing a group label. group=rep(c(1,2,3),times=nr[1,]) Then you can use tapply to apply a function (in this case mean and variance) of the values of x within each

Re: [R] means and variances of several groups in the matrix

2008-04-21 Thread Jim Lemon
kathie wrote: Dear R users, I have 32 observations in data x. After sorting this, I want to compute means and variances of 3 groups divided by nr. Actually, the number of groups is flexible. Any suggestion will be greatly appreciated. Hi Kathryn, One way (there are many others) is

[R] means and variances of several groups in the matrix

2008-04-21 Thread kathie
Dear R users, I have 32 observations in data x. After sorting this, I want to compute means and variances of 3 groups divided by nr. Actually, the number of groups is flexible. Any suggestion will be greatly appreciated. Kathryn Lord