Ulrich Halekoh
2011-Sep-03 21:56 UTC
[R] glht (multcomp): NA's for confidence intervals using univariate_calpha
Hej, Calculation of confidence intervals for means based on a model fitted with lmer using the package multcomp - yields results for calpha=adjusted_calpha - NA's for calpha=univariate_calpha Example: library(lme4) library(multcomp) ### Generate data set.seed(8) d<-expand.grid(treat=1:2,block=1:3) e<-rnorm(3) names(e)<-1:3 d$y<-rnorm(nrow(d)) + e[d$block] d<-transform(d,treat=factor(treat),block=factor(block)) ##### lmer fit Mod<-lmer(y~treat+ (1|block), data=d) ### estimate treatment means L<-cbind(c(1,0),c(0,1)) s<-glht(Mod,linfct=L) ## confidence intervals confint(s,calpha=adjusted_calpha()) #produces NA's for the confidence limits confint(s,calpha=univariate_calpha()) #for models fitted with lm the problem does not occur G<-lm(y~treat+ block, data=d) L<-matrix( c(1,0,1/3,1/3,1,1,1/3,1/3),2,4,byrow=TRUE) s<-glht(G,linfct=L) confint(s,calpha=adjusted_calpha()) confint(s,calpha=univariate_calpha()) multcomp version 1.2-7 R:platform i386-pc-mingw32 version.string R version 2.13.1 Patched (2011-08-19 r56767) Regards Ulrich Halekoh Department of Molecular Biology and Genetics, Aarhus University, Denmark Ulrich.Halekoh at agrsci.dk
Possibly Parallel Threads
- glht (multcomp): NA's for confidence intervals using univariate_calpha (fwd)
- glht: Problem with symbolic contrast for factors with number-levels
- How to display y-axis labels in Multcomp plot
- glht function in multcomp gives unexpected p=1 for all comparisons
- GLHT in multcomp: Two similar models, one doesn't work