What do you think about the following:
library(nlme)
set.seed(1)
n <- 3;m <- 4
s.e <- 0
(X0 <- array(rep(rnorm(n), each=m)+s.e*rnorm(m*n),
dim=c(m, n)))
s.e <- 1
(X1 <- array(rep(rnorm(n), each=m)+s.e*rnorm(m*n),
dim=c(m, n)))
X. <- data.frame(Row=as.vector(row(X)),
Col=as.vector(col(X)),x=as.vector(X1))
lme(x~Col, random=~1|Col, data=X.)
For more information on this, I highly recommend Pinheiro and Bates
(2000) Mixed-Effects Models in S and S-Plus (Springer).
spencer graves
Roy Werkman wrote:> Hi,
>
> Although my question is not directly linked to R functionality, I hope
> you can forgive me for posing it here. I have been looking for the
> answer for a long time (~ 4 weeks) and have not been able to find it. My
> question is:
>
> Suppose I have an m*n matrix, with a random (normally distributed)
> number per cell. Added to that I have a random number per column. I want
> to determine the standard deviation of both distributions. For the
> column-to-column (coco) sd I do following:
>
> sd(coco) = sqrt( sd(column averages)^2 - C * sd(cece)^2 /m )
>
> Where C = (m*n-1) / (m*n-n) , and sd(cece) is the sd over the matrix
> with the column averages subtracted.
>
> My question: how can I calculate the confidence interval on sd(coco)?
>
>
> I would really appreciate your help,
> Roy Werkman
>
>
--
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA
spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel: 408-938-4420
Fax: 408-280-7915