[R-sig-ME] glmmadmb random effects help
ONKELINX, Thierry
Thierry.ONKELINX at inbo.be
Tue Nov 25 12:12:05 CET 2014
Dear Greg,
1) Residuals versus fit don't make that much sense in case of a glm. I'd rather look at the residuals versus the covariates.
2) It looks like you are interpreting the main effects. Don't forget that you have included interactions with temp. You cannot interpret main effects without the interaction terms. Make plots to inspect their combined effect.
3) centering should not affect the parameter estimates, scaling will do that.
PS releveling the factors prior to the analysis gives cleaner output
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
Van: Hacker, Greg (CDPH-CID-DCDC) [mailto:Greg.Hacker op cdph.ca.gov]
Verzonden: maandag 24 november 2014 21:08
Aan: ONKELINX, Thierry; r-sig-mixed-models op r-project.org
Onderwerp: RE: glmmadmb random effects help
Thank you for your response! I finally got back to looking at the data and after adjusting my models like you said I get a top model like this:
Call:
glmmadmb(formula = Tot_I_pac ~ temp + hum + temp:hum + fSeason +
temp:fSeason + relevel(Dom.Overstory, ref = "None") + relevel(Dom.Understory,
ref = "Sage") + relevel(Aspect, ref = "S") + (1 | Month) +
(1 | fTrans/fSite), data = Ticks, family = "nbinom")
AIC: 7538.9
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -3.0600 1.5585 -1.96 0.04960 *
temp 1.1624 0.3052 3.81 0.00014 ***
hum -0.0300 0.0918 -0.33 0.74418
fSeason2 -0.4756 0.1494 -3.18 0.00146 **
fSeason3 -0.6348 0.1422 -4.46 8.1e-06 ***
relevel(Dom.Overstory, ref = "None")Gray Pine 1.2139 0.2796 4.34 1.4e-05 ***
relevel(Dom.Overstory, ref = "None")Oak 0.9111 0.1638 5.56 2.7e-08 ***
relevel(Dom.Understory, ref = "Sage")Fern 0.4565 0.3350 1.36 0.17300
relevel(Dom.Understory, ref = "Sage")Grass -0.0842 0.2387 -0.35 0.72427
relevel(Dom.Understory, ref = "Sage")Poison Oak 0.0232 0.2706 0.09 0.93166
relevel(Dom.Understory, ref = "Sage")Woody Forb -0.3829 0.2826 -1.36 0.17541
relevel(Aspect, ref = "S")E -0.3922 0.2562 -1.53 0.12574
relevel(Aspect, ref = "S")N -0.5272 0.3459 -1.52 0.12742
relevel(Aspect, ref = "S")NW -0.4281 0.3530 -1.21 0.22519
relevel(Aspect, ref = "S")SE -0.0537 0.3322 -0.16 0.87160
relevel(Aspect, ref = "S")SSW -0.1702 0.2886 -0.59 0.55534
relevel(Aspect, ref = "S")SW 0.2673 0.3304 0.81 0.41866
relevel(Aspect, ref = "S")W 0.2274 0.2780 0.82 0.41337
temp:hum -0.7485 0.1365 -5.49 4.1e-08 ***
temp:fSeason2 0.3925 0.2863 1.37 0.17042
temp:fSeason3 -0.5624 0.2435 -2.31 0.02091 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Number of observations: total=3190, Month=11, fTrans=11, fTrans:fSite=110
Random effect variance(s):
Group=Month
Variance StdDev
(Intercept) 23.46 4.844
Group=fTrans
Variance StdDev
(Intercept) 0.3047 0.552
Group=fTrans:fSite
Variance StdDev
(Intercept) 0.1431 0.3783
Negative binomial dispersion parameter: 1.3755 (std. err.: 0.096618)
Log-likelihood: -3744.43
I have some additional questions I was hoping you could answer.
1) I don't quite understand how to interpret the plot of fitted vs. residuals generated from this model. Can anyone lend a hand here?
2) The temp, hum, and fseason coefficients don't seems to reflect what the raw data shows. Generally, tick numbers should decrease with increased temp, increase with increased humidity, and my data show that seasons 1 and 3 had similar numbers of ticks and season two was drastically lower. Is this all a result of poor model fit? If so, what other model types or families can I try?
3) I'm getting different coefficient estimates of the top model with scaled and centered parameters and the same model without. For example, the model with scaled params results in a coef for temp=1.1624, but the same model with just raw numbers results in temp=0.351. Is this just a function of the scaling?
Thank you again!
Greg
-----Original Message-----
From: ONKELINX, Thierry [mailto:Thierry.ONKELINX op inbo.be]
Sent: Monday, November 10, 2014 12:11 AM
To: Hacker, Greg (CDPH-CID-DCDC); r-sig-mixed-models op r-project.org
Subject: RE: glmmadmb random effects help
Dear Greg,
You need to use (1|fTrans/fSite). This is site nested in transect. Note that the random effect of transect should have 11 observation and not 110 as in your current summary.
Month will be crossed with site (and transect).
You could calculate the AIC by hand to check if the AIC in the summary is correct.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey
________________________________________
Van: r-sig-mixed-models-bounces op r-project.org [r-sig-mixed-models-bounces op r-project.org] namens Hacker, Greg (CDPH-CID-DCDC) [Greg.Hacker op cdph.ca.gov]
Verzonden: vrijdag 7 november 2014 19:01
Aan: r-sig-mixed-models op r-project.org
Onderwerp: [R-sig-ME] glmmadmb random effects help
Hello all,
I am hoping to get some expert guidance on an analysis I am attempting. At the very least I hope you can tell me if I'm on the right track. If I'm not, maybe you can nudge me in the right direction.
I have data that consists of repeated counts of ticks that were collected at 110 different sites around a portion of a reservoir. These 110 sites were grouped into 11 transects (I'm thinking nesting here). The counts were collected monthly (although some months were missed) over 3 years (years = Oct-Sept to account for tick biology). Along with this I have several continuous and categorical ecological variables (e.g., canopy coverage, dominant overstory/understory veg, average temp, relative humidity, aspect, etc...). I'm hoping to create a candidate set of models that I can then use AIC (or something related) to determine the best fit. In the end I'm hoping to have a model that can reasonably predict abundance of ticks based on a subset of environmental variables.
>From what I've read I have too few seasons to use as a random effect. I believe the month, site, and transect variables should all be considered random effects, with site nested in transect. However, site/transect is also crossed with month and season(fixed effect). Below I have provided the output (minus the coefs for fixef) from the summary of my global model (at least the most complex model I could use without getting errors).
Call:
glmmadmb(formula = Tot_I_pac ~ SWave.max.temp + ave.rh + SWave.max.temp:ave.rh +
Perc_Canopy + Dom.Overstory + Perc_Canopy * Dom.Overstory +
Dom.Midstory + Dom.Understory + Aspect + Soil.Type + fSeason +
(1 | Month) + (1 | fSite/fTrans), data = Ticks, family = "nbinom")
AIC: 7589
Number of observations: total=3190, Month=11, fSite=110, fSite:fTrans=110 Random effect variance(s):
Group=Month
Variance StdDev
(Intercept) 18.8 4.336
Group=fSite
Variance StdDev
(Intercept) 0.1429 0.378
Group=fSite:fTrans
Variance StdDev
(Intercept) 0.1061 0.3257
Negative binomial dispersion parameter: 1.4 (std. err.: 0.096)
Log-likelihood: -3762
Does everything seem reasonable here? Does the way I wrote the random effects portion of the model relate to the description of the data? Does this model take into account that month and the site/transect combination are crossed with season? Finally, is the AIC score provided in the summary what should be used to rank the models or should it be ignored and calculated by hand (does the AICtab function utilize this score)?
Forgive me, I am only a wildlife biologist who knows only enough to get myself into trouble! Thank you in advance for any advice folks can provide!
Cheers!
Greg
Greg Hacker
Biologist
Public Health Foundation Enterprises
California Department of Public Health
Vector-Borne Disease Section
8633 Bond Rd.,
Elk Grove, CA 95624
[[alternative HTML version deleted]]
_______________________________________________
R-sig-mixed-models op r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * * Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.
More information about the R-sig-mixed-models
mailing list