[R-gregmisc-users] SF.net SVN: r-gregmisc:[1520] trunk/gmodels/R/est.mer.R
Brought to you by:
warnes
From: <wa...@us...> - 2011-12-14 18:14:14
|
Revision: 1520 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1520&view=rev Author: warnes Date: 2011-12-14 18:14:03 +0000 (Wed, 14 Dec 2011) Log Message: ----------- Modify est.mer to work with recent lme4 'mer' S4 objects. Modified Paths: -------------- trunk/gmodels/R/est.mer.R Modified: trunk/gmodels/R/est.mer.R =================================================================== --- trunk/gmodels/R/est.mer.R 2011-12-09 09:22:25 UTC (rev 1519) +++ trunk/gmodels/R/est.mer.R 2011-12-14 18:14:03 UTC (rev 1520) @@ -7,19 +7,18 @@ est.mer <- function(obj, cm, beta0, conf.int, show.beta0, n.sim) { -## if(!require(coda, quietly=TRUE)) -## stop("coda package required when sim.mer == TRUE") samp <- mcmcsamp(obj, n.sim) -## samp.summ <- summary(samp) + ## samp.summ <- summary(samp) if(is.null(dim(cm))) n <- length(cm) else n <- dim(cm)[2] - # drop extra information on end - samp.cm <- as.matrix(samp)[, 1:n] %*% t(cm) + ## drop extra information on end + samp.cm <- as.matrix(samp@fixef)[, 1:n] %*% t(cm) + # calculate requested statistics est <- apply(samp.cm, 2, mean) stderr <- sd(samp.cm) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |