[R-sig-ME] glmer - help with t values

Ben Bolker bolker at ufl.edu
Fri Nov 13 21:56:37 CET 2009


Elisa Fuentes-Montemayor wrote:
> Hi,
> 
> I'm new in R and I've performed a glmer with several factors, but more than two levels in some of the factors. In the output I get after performing the glmer I obtain t values for each of the factor levels, like this:
> 
> Fixed effects:
>                                 Estimate Std. Error t value
> (Intercept)                      3.72592    2.71117   1.374
> Farm.typeCONV                   -1.17776    0.36591  -3.219
> HabitatHR                        0.55193    0.23882   2.311
> HabitatSRG                       0.08069    0.25854   0.312
> HabitatWM                        0.42429    0.23221   1.827
> ActivityMixed                    1.33646    0.41566   3.215
> ActivityPastoral                -0.71769    1.62846  -0.441
> 
> But what I really need is an overall t value for each factor (Farm.type, Habitat, Activity). Could anyone please tell me how I can do this?
> 
> Thanks!
> 
> Elisa
> 

  What you need is a Wald F value, rather than a Wald t value

http://glmm.wikidot.com/local--files/examples/glmmfuns.R
has a waldF(object, variable, den.df) function where "object"
is your lme4 fit, "variable" is the name of your variable,
and "den.df" is your denominator df (you can just make it NA):

e.g.

tmp <- "http://glmm.wikidot.com/local--files/examples/glmmfuns.R"
source(url(tmp))

set.seed(1001)
x <- runif(300)
f <- factor(rep(LETTERS[1:3],each=100))
g <- factor(rep(letters[1:10],each=30))
params <- list(slope=2,int=c(-0.5,0.5,1),
               grp=rnorm(10,sd=1))
eta <- with(params,int[f]+slope*x+grp[g])
y <- rbinom(300,prob=plogis(eta),size=10)
X <- data.frame(x,f,y)

library(lme4)
m1 <- glmer(cbind(y,10-y)~f+x+(1|g),data=X,family=binomial)
summary(m1)

waldF(m1,"f",NA)



> Elisa Fuentes-Montemayor, MSc
> PhD student
> School of Biological & Environmental Sciences
> University of Stirling
> Stirling FK9 4LA
> Scotland, UK
> http://www.sbes.stir.ac.uk/people/postgrads/fuentes-montemayor.html
> 
> 
> 
> 


-- 
Ben Bolker
Associate professor, Biology Dep't, Univ. of Florida
bolker at ufl.edu / www.zoology.ufl.edu/bolker
GPG key: www.zoology.ufl.edu/bolker/benbolker-publickey.asc




More information about the R-sig-mixed-models mailing list