[R-gregmisc-users] SF.net SVN: r-gregmisc: [1075] trunk/gmodels
Brought to you by:
warnes
From: <wa...@us...> - 2007-03-09 20:06:36
|
Revision: 1075 http://svn.sourceforge.net/r-gregmisc/?rev=1075&view=rev Author: warnes Date: 2007-03-09 12:06:05 -0800 (Fri, 09 Mar 2007) Log Message: ----------- Flip lower and upper interval in ci.lmer(). Add example to man page. Modified Paths: -------------- trunk/gmodels/R/est.lmer.R trunk/gmodels/man/ci.Rd Modified: trunk/gmodels/R/est.lmer.R =================================================================== --- trunk/gmodels/R/est.lmer.R 2007-03-09 19:43:05 UTC (rev 1074) +++ trunk/gmodels/R/est.lmer.R 2007-03-09 20:06:05 UTC (rev 1075) @@ -24,7 +24,8 @@ est <- drop(cm %*% samp.summ$statistics[1:n,1]) stderr <- sd(samp.cm) - pval <- sapply(1:length(beta0), function(i){percentile(beta0[i], samp.cm[,i])}) + pval <- sapply(1:length(beta0), + function(i){percentile(beta0[i], samp.cm[,i])}) pval <- ifelse(pval <= .5, 2*pval, 2*(1-pval)) if(is.null(conf.int)) @@ -33,10 +34,15 @@ upper.ci <- NULL }else{ alpha <- 1-conf.int - samp.ci <- sapply(1:length(beta0), function(i){quantile(samp.cm[,i], probs=c(alpha/2, 1-alpha/2))}) + samp.ci <- sapply(1:length(beta0), + function(i) + { + quantile(samp.cm[,i], probs=c(alpha/2, 1-alpha/2)) + } + ) - lower.ci <- samp.ci[2,] - upper.ci <- samp.ci[1,] + lower.ci <- samp.ci[1,] + upper.ci <- samp.ci[2,] } # return results Modified: trunk/gmodels/man/ci.Rd =================================================================== --- trunk/gmodels/man/ci.Rd 2007-03-09 19:43:05 UTC (rev 1074) +++ trunk/gmodels/man/ci.Rd 2007-03-09 20:06:05 UTC (rev 1075) @@ -66,5 +66,13 @@ reg <- lm(Area ~ Population, data=as.data.frame(state.x77)) ci(reg) +\dontrun{ +# lmer example +library(lme4) +fm2 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy) +ci(fm2) } + + +} \keyword{ regression } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |