Cant you just save that column of values to an object stddev<-VC[,2]#if it's the second column that has the values
also I wouldn't save your model name in the same name as the command, when you have " lmer<-lmer(y~1+(1|sampfac)+(1|labfac))", may be best to have "lmer.mod<-lmer(y~1+(1|sampfac)+(1|labfac))" or something. Joe King 206-913-2912 j...@joepking.com Ad astra per aspera - "Through hardships to the stars" -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Stephanie Cooke Sent: Wednesday, January 19, 2011 11:33 AM To: r-help@r-project.org Subject: [R] VarCorr I have a loop that I would like to use to extract the "stddev" for each itteration so I can average the "stddev" for all the runs. It would be helpful to know how to extract the "stddev" for each run from the VarCorr. Thanks MCruns<-1000 sighatlvec<-rep(NA,MCruns) sighatbvec<-rep(NA,MCruns) sighatevec<-rep(NA,MCruns) for(mc in 1:MCruns) { samples<-(sqrt(sigbsq)*rnorm(6)) labs<-(sqrt(siglsq)*rnorm(2)) errors<-(sqrt(sigesq)*rnorm(24)) y<-errors+samples[sampfac]+labs[labfac] lmer<-lmer(y~1+(1|sampfac)+(1|labfac)) print(VC<-VarCorr(lmer)) } ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.