[R-sig-ME] random effects with nbinom glmmadmb
Diaci, Jurij
Jurij.Diaci at bf.uni-lj.si
Sat Dec 21 09:09:34 CET 2013
Dear Ben,
thank you very much for the help.
*1 Sorry for the mistake with fixed effects. This was due to translation of variable names from
Slovene. In this replay R output is original, and the legend is following:
Odd = opening, random 4 levels
PL_VR = relief, fixed 2 levels (sinkhole and plateau)
N_O = fence, fixed 2 levels
C_S = location, fixed 2 levels (forest edge and center)
*2 You were right about including of "opening" as fixed effect. Results are appended below.
*3a Below are also results from GLMM. I've applied anova test for two fits - one without fence
effects and the differnce is not significant (p = 0.05919).
Should I proceed in this way for all the effects and report this p values in paper? I usually work
with glm.nb and drop1 function to get significant effects and then continue with glmmadmb which is
slower. Is this OK?
*3b I've tried also mcmc.opts with 1000 iterations and results look OK.
I've got so far following estimates and errors (parenthesis) for fence (N_O) effect:
GLM with opening 0.444(0.118)
GLM without opening 0.862(0.244)
GLMM 0.488(0.211)
GLMM with MCMC 0.542(0.315)
(1000 iterations)
How many iterations are neccessary?
I guess there are no p values for the effects in mcmc, but only estimates and errors?
Shuld I report comparative anova results for p values, and estimates and errors from MCMC?
How can the geweke.diag outpot for N_O[T.og] 1.0322 be interpreted?
*3c Vinnete example works fine, thank you very much. I've found only one problem/error with the
line:
# tm <- tm[, !grepl("^u\\", colnames(m))]
# Error in grepl("^u\\", colnames(m)) : invalid regular expression '^u\', reason 'Trailing backslash'
Best regards,
Jurij
*******************************************************
Ad *2 Results from GLM with oppening as a fixed effect.
Call:
glm.nb(formula = sm_si ~ PL_VR + N_O + C_S + Leto + PL_VR:C_S +
Odd, data = krese2, link = "log", init.theta = 0.6738688778)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.1282 -1.1526 -0.4309 0.3075 2.8425
Coefficients: (1 not defined because of singularities)
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.3243 0.1696 7.807 5.84e-15 ***
PL_VR[T.vrt] 0.2319 0.1668 1.390 0.164455
N_O[T.og] 0.8618 0.2437 3.536 0.000405 ***
C_S[T.rob] 0.7444 0.1664 4.473 7.70e-06 ***
Leto[T.2013] -0.4120 0.1167 -3.531 0.000415 ***
Odd[T.39] -0.1253 0.2361 -0.531 0.595541
Odd[T.42] 0.5644 0.1669 3.381 0.000723 ***
Odd[T.51] NA NA NA NA
PL_VR[T.vrt]:C_S[T.rob] -0.5412 0.2368 -2.285 0.022301 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for Negative Binomial(0.6739) family taken to be 1)
Null deviance: 610.76 on 479 degrees of freedom
Residual deviance: 545.05 on 472 degrees of freedom
AIC: 2927.7
Number of Fisher Scoring iterations: 1
Theta: 0.6739
Std. Err.: 0.0487
2 x log-likelihood: -2909.6520
*******************************************************
Ad *3a Results from GLMM
Call:
glmmadmb(formula = sm_si ~ PL_VR + N_O + C_S + Leto + PL_VR:C_S +
(1 | Odd), data = krese2, family = "nbinom")
AIC: 2933.7
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.588 0.194 8.20 2.4e-16 ***
PL_VRvrt 0.243 0.170 1.43 0.15350
N_Oog 0.488 0.211 2.31 0.02082 *
C_Srob 0.785 0.172 4.56 5.0e-06 ***
Leto2013 -0.408 0.118 -3.46 0.00054 ***
PL_VRvrt:C_Srob -0.541 0.240 -2.26 0.02413 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Number of observations: total=480, Odd=4
Random effect variance(s):
Group=Odd
Variance StdDev
(Intercept) 0.02702 0.1644
Negative binomial dispersion parameter: 0.66844 (std. err.: 0.048389)
Log-likelihood: -1458.86
*******************************************************
Ad *3b
Iterations = 1:1000
Thinning interval = 1
Number of chains = 1
Sample size per chain = 1000
1. Empirical mean and standard deviation for each variable,
plus standard error of the mean:
Mean SD Naive SE Time-series SE
(Intercept) 1.589093 0.25872 0.008182 0.049969
PL_VR[T.vrt] 0.230967 0.16032 0.005070 0.024057
N_O[T.og] 0.542544 0.31503 0.009962 0.066181
C_S[T.rob] 0.784867 0.17890 0.005657 0.028402
Leto[T.2013] -0.369402 0.11369 0.003595 0.017880
PL_VR[T.vrt]:C_S[T.rob] -0.540553 0.22776 0.007203 0.032046
tmpL 0.268618 0.19983 0.006319 0.049266
alpha 0.664778 0.04325 0.001368 0.006534
u.1 0.009318 0.50282 0.015900 0.099104
u.2 -0.245842 0.70595 0.022324 0.131085
u.3 0.650843 0.55947 0.017692 0.118921
u.4 -0.872515 0.69354 0.021932 0.201181
2. Quantiles for each variable:
2.5% 25% 50% 75% 97.5%
(Intercept) 0.930400 1.4410 1.5882 1.7564 2.0519
PL_VR[T.vrt] -0.066268 0.1125 0.2209 0.3400 0.5594
N_O[T.og] -0.009899 0.3491 0.5050 0.6717 1.3622
C_S[T.rob] 0.414240 0.6696 0.7848 0.9348 1.0667
Leto[T.2013] -0.621706 -0.4321 -0.3664 -0.3002 -0.1434
PL_VR[T.vrt]:C_S[T.rob] -1.033963 -0.7135 -0.5374 -0.3748 -0.1126
tmpL 0.004204 0.1227 0.2268 0.3824 0.7823
alpha 0.589223 0.6349 0.6655 0.6885 0.7551
u.1 -1.014267 -0.2826 0.0225 0.3082 1.0957
u.2 -1.735785 -0.6892 -0.1468 0.2218 0.9345
u.3 -0.370678 0.2548 0.6098 1.0719 1.7863
u.4 -2.133338 -1.3691 -0.9411 -0.3733 0.5059
More information about the R-sig-mixed-models
mailing list