Re: [R] Efficient computation of average covariance matrix over a list

2007-12-03 Thread Moshe Olshansky
I believe that computing covariance matrices takes much more time than computing their average and so it does not matter how you do this, but one possibility is: z<- lcov[[1]]*0 y <- sapply(lcov,function(x) {z<<-z+x;0;}) y <- y/length(lcov) --- Rick DeShon <[EMAIL PROTECTED]> wrote: > Hi All. >

[R] Efficient computation of average covariance matrix over a list

2007-12-03 Thread Rick DeShon
Hi All. I would like to compute a separate covariance matrix for a set of variables for each of the levels of a factor and then compute the average covariance matrix over the factor levels. I can loop through this computation but I need to perform the calculation for a large number of levels and

[R] Efficient computation of average covariance matrix over a list

2007-12-03 Thread Rick DeShon
Hi All. I would like to compute a separate covariance matrix for a set of variables for each of the levels of a factor and then compute the average covariance matrix over the factor levels. I can loop through this computation but I need to perform the calculation for a large number of levels and