Dear Tom Philippi:

Thank you for answering my question, sorry but I do not understand the
difference in your example, between this (letters in red):

m1 <-  lmer(Size~Time +Zone + (1+Time|ZP),
            data=LottiaData)

and this:

 m1a <-  lmer(Size~Time +Zone + (1|ZP),
             data=LottiaData)

Season, month and tide are categorical factors; and I have measurements on
individual pups with observations at snapshots in time.

Thank you for you valuable help..
Karina




2011/12/16 <Tom_Philippi@nps.gov>

> Karina--
>
> Your question on p values is in the R mixed effects FAQ:
> http://glmm.wikidot.com/faq
> You might not get an answer fro the gods of R-sig-ME because of that
> question.
>
> P values for the fixed effects are best estimated from liklihood ratio
> tests.  Fit the full model, then fit a model with all but 1 fixed effect,
> and run anova() on those 2 models.  Repeat this as a sequence of nested
> models to test each fixed effect.  Note that the order of the terms in your
> formula matters.
>
> For example, in my testing of effects of zone and time (what's open in my
> editor right now) on limpet mean sizes:
> full.model <- lmer(Size~Time*Zone + (1+Time|ZP),
>                   data=LottiaData)
>  # no zone by time interaction
>  m1 <-  lmer(Size~Time +Zone + (1+Time|ZP),
>             data=LottiaData)
>  m1a <-  lmer(Size~Time +Zone + (1|ZP),
>              data=LottiaData)
> # no temporal trend
>  m2 <-  lmer(Size~ Zone + (1|ZP),
>              data=LottiaData)
>  # no main effect of zone
>  m3 <-  lmer(Size~ Time + (1|ZP),
>             data=LottiaData)
>  # no main effect of zone or time (mean only)
>  m4 <- lmer(Size~ (1|ZP),
>            data=LottiaData)
> # Tests of terms
> zone.time <- anova(full.model,m1)
> main.time <- anova(m1a,m2)
> main.zone <- anova(m1a,m3)
> null.time <- anova(m3,m4)
> null.zone <- anova(m2,m4)
>
>
> # parameter estimates and confidence intervals
> # separate parameter estimates
> m0 <-  lmer(Size~0 + Zone + Zone:Time + (1+Time|ZP),
>            data=LottiaData)
> m0.coefs <- summary(m0)@coefs
> str(m0.coefs)
> ests <- m0.coefs[,1]
> ests.uci <-m0.coefs[,1]+1.96*m0.coefs[,2]
> ests.lci <- m0.coefs[,1]-1.96*m0.coefs[,2]
> m0.ests <- data.frame(ests,ests.uci,ests.lci)
> print(m0.ests)
>
>
> Not knowing what each of your variables are nor the structure of your data,
> I can't tell you whether your model is "correct", and there probably isn't
> a single correct model.  However, I suspect that you are asking for way too
> many random effects for your sample size, given that you are looking at sea
> lions, which have few pups per brood and at most 1 brood per year.
>
> If sexo is the offspring sex, you probably need to include that as a fixed
> effect instead of random effect: you (hopefully) aren't generalizing to all
> possible sexes, and only having 2 values means that the estimates for the
> variance due to sex  will be very imprecise.
>
> How are you coding season, month, & tide? (temporada, mes, & marea)?  Are
> they categorical factors, or numeric?
> with(Datos,table(Mes,Marea))
> with(Datos,table(Temporada,Mes,Marea))
>
> Do you have repeated measurements on individual pups over time, or simply
> observations on individuals at snapshots in time?
>
> I hope that this helps you.
> Tom
>
> -------------------------------------------
> Tom Philippi, Ph.D.
> Quantitative Ecologist
> Inventory and Monitoring Program
> National Park Service
> c/o Cabrillo National Monument
> 1800 Cabrillo Memorial Dr
> San Diego, CA 92106
> (619) 523-4576
> Tom_philippi@NPS.gov
> http://science.nature.nps.gov/im/monitor
> -------------------------------------------
>
>
>
>
>             Karina Villegas
>             <villegaskary@gma
>             il.com>                                                    To
>             Sent by:                  r-sig-mixed-models@r-project.org
>             r-sig-mixed-model                                          cc
>             s-bounces@r-proje
>             ct.org                                                Subject
>                                       [R-sig-ME] Advice
>
>             12/16/2011 11:04
>             AM PST
>
>
>
>
>
>
>
> Dear R-mixed-model-experts:
>
> I am running R version 2.12.1 on Windows 2007. I am studying environmental
> factors and maternal behavior in the body condition of sea lion pups from
> California.
>
> I specified my model as follows:
>
> Model <- lmer
>
> (Condicion~DuracionNurse+FrecNurse+FrecInteraccion+Temperatura+Densidad+(1|Mes)+(1|Zona)+(1|Sexo)+(1|Marea)+(1|Temporada),
>
> family=gaussian, data=Datos)
>
> (See output below)
>
> At this point, my main questions are:
>
> 1. Is my model correctly built?
>
> 2. Why don’t I get p values for t?
>
> 3. Is there any way to compute p values for the fixed effects?
>
>
> Linear mixed model fit by REML
> Formula: Condicion ~ DuracionNurse + FrecNurse + FrecInteraccion +
> Temperatura +      Densidad + (1 | Mes) + (1 | Zona) + (1 | Sexo) + (1
> | Marea) +      (1 | Temporada)
>   Data: Datos
>   AIC   BIC logLik deviance REMLdev
>  646.6 682.5 -311.3    619.1   622.6
> Random effects:
>  Groups    Name        Variance   Std.Dev.
>  Mes       (Intercept) 2.8159e-01 5.3065e-01
>  Marea     (Intercept) 2.1107e-01 4.5943e-01
>  Zona      (Intercept) 2.1056e-01 4.5886e-01
>  Temporada (Intercept) 1.4041e-01 3.7472e-01
>  Sexo      (Intercept) 6.9748e-11 8.3515e-06
>  Residual              3.8768e+00 1.9690e+00
> Number of obs: 147, groups: Mes, 4; Marea, 3; Zona, 3; Temporada, 2; Sexo,
> 2
>
> Fixed effects:
>                 Estimate Std. Error t value
> (Intercept)      69.01515   17.74172   3.890
> DuracionNurse     0.04564    0.27483   0.166
> FrecNurse         3.00491    0.79289   3.790
> FrecInteraccion  -0.62826    0.17585  -3.573
> Temperatura      -2.87229    0.91138  -3.152
> Densidad        -18.78045    6.22638  -3.016
>
> Correlation of Fixed Effects: (Intr) DrcnNr FrcNrs FrcInt Tmprtr
> DuracionNrs 0.741 FrecNurse 0.945 0.582 FrecIntrccn -0.965 -0.691 -0.977
> Temperatura -0.999 -0.741 -0.954 0.972 Densidad -0.919 -0.878 -0.823 0.862
> 0.915
>
> I appreciate very much in advance for your help and I hope your answer.
> Best Regards..
>
> Karina
>
>
> --
> Biol. Karina Villegas Cervantes
> Estudiante de Maestría PCMyL - UNAM
>
> Laboratorio de Ecologia de Pinnipedos Burney J. Le Boueuf.
> CICIMAR-IPN
> Av. Instituto Politecnico Nacional s/n.Col.Playa Palo de Santa Rita
> La Paz Baja California Sur, Mexico.
>
>              [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



-- 
Biol. Karina Villegas Cervantes
Estudiante de Maestría PCMyL - UNAM

Laboratorio de Ecologia de Pinnipedos Burney J. Le Boueuf.
CICIMAR-IPN
Av. Instituto Politecnico Nacional s/n.Col.Playa Palo de Santa Rita
La Paz Baja California Sur, Mexico.

	[[alternative HTML version deleted]]


