I have a question following the great response @DaveArmstrong answered in this topic about sum contrast coding.
To first introduce my problem, have a model to account for species richness which is:
model = glmmTMB(richness~ season + scale(year)*soil_type + (1|plot/place),
family = "poisson", data = data,
contrasts = list(soil_type= "contr.sum"))
richnessare count data.seasonandsoil_typeare categorical variables, but I treatseasonwith a basic treatment contrast. I only applied sum contrast onsoil_type.yearis the time (scaled), so a quantitative variable.plotandplaceare random effects.
My issue is that I can't understand the output, and especially:
- What does in this case the intercept represent? Since
seasonis coded with treatment contrast andsoil_typewith sum coding? Is this even coherent to do? - How can I find the estimate of the last level of my factor
soil_typesince the output doesn't plot it?
Here's below the output of my model:
> summary(model)
Family: poisson ( log )
Formula: richness ~ season + scale(year) * occ_sol_mix + (1 | plot/place)
Data: data
AIC BIC logLik deviance df.resid
30805.1 30916.5 -15385.5 30771.1 5171
Random effects:
Conditional model:
Groups Name Variance Std.Dev.
station:maille (Intercept) 0.18499 0.4301
maille (Intercept) 0.03717 0.1928
Number of obs: 5188, groups: station:maille, 1366; maille, 175
Conditional model:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.389147 0.022763 104.96 < 2e-16 ***
seasonspring 0.097723 0.007769 12.58 < 2e-16 ***
scale(year) -0.047237 0.005340 -8.85 < 2e-16 ***
soil_type1 -0.829020 0.029872 -27.75 < 2e-16 ***
soil_type2 -0.056194 0.053894 -1.04 0.297095
soil_type3 0.394487 0.056035 7.04 1.92e-12 ***
soil_type4 0.484181 0.029935 16.17 < 2e-16 ***
soil_type5 -0.226980 0.052702 -4.31 1.66e-05 ***
soil_type6 -0.334582 0.030146 -11.10 < 2e-16 ***
scale(year):soil_type1 -0.047871 0.011518 -4.16 3.24e-05 ***
scale(year):soil_type2 -0.018347 0.017078 -1.07 0.282680
scale(year):soil_type3 -0.003713 0.014529 -0.26 0.798287
scale(year):soil_type4 -0.023846 0.007869 -3.03 0.002443 **
scale(year):soil_type5 0.056602 0.017220 3.29 0.001013 **
scale(year):soil_type6 0.036098 0.009743 3.70 0.000212 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1