2
$\begingroup$

I am using a glmm to find the effect of lockdown (Yes or No), sex (Male or Female), age (Young, Teenager, Adult) and site (A or B) on hormone concentrations (Continuous). Using lrtest, I have compared different nested models with each other to determine the significance of the different explanatory variables. However, I am unsure how to find the significance of different levels.

My final model is: Concentration ~ Lockdown + Age + Sex + Site + LockdownSex + SiteSex + (1|individual).

When I run "anova(model)" it gives me the values for only one level of each variable, i.e. SiteA:SexMale. How can I get the significance of other levels in the interaction, i.e. SiteB:SexFemale?

summaryofmodel

anova

$\endgroup$
3
  • $\begingroup$ It would help if you could show the summary() of the model and what anova() reported. Use the code {} button on the toolbar to format your output. This might be something as simple as the fact that the intercept is for the situation when all predictors are at reference levels so you only get 1 coefficient reported for each of lockdown, sex, and site, 2 for your categorized age, and 1 for each of the interactions between dichotomous predictors. Or there might be something else going on. We'd need to see the output to know for sure. After you do that, say just what you think is missing. $\endgroup$
    – EdM
    Jul 17 at 16:07
  • $\begingroup$ Thank you, I have added two screenshots of the output to my question. Some of the names of each variable have changed (i.e. site to population and the levels of age). As you can see, it is showing me the values for the interactions between lockdown (during) and sex (male) etc. How do I see the values for the other levels of the interactions? Such as lockdown (after) and sex (female). Thank you for your help :) $\endgroup$
    – EllaB96
    Jul 18 at 10:50
  • $\begingroup$ I am also unsure of what the reference level for each interaction is $\endgroup$
    – EllaB96
    Jul 18 at 12:19

2 Answers 2

1
$\begingroup$

With interactions and default coding in R, the regression coefficients at each level represent differences of outcomes from what would be predicted based on lower-level coefficients. That is, the intercept is the predicted outcome when all predictors are at reference levels (categorical predictors) or 0 (continuous predictors). Each individual coefficient is the difference from the intercept associated with that predictor when other predictors are at reference/0. Each 2-way interaction coefficient is the extra difference for the 2 predictors when neither of them is at reference/0 but other predictors are.

Although the standard output of coefficient estimates thus shows fewer values than you have combinations of predictors, the information is still in the model to get predictions and standard errors/p-values for any combination of predictor values, or for differences between predictions. This can be done by hand by combining the coefficient estimates, the covariance matrix of the estimates (not shown in the display, but included in the object produced by the model), and the formula for the variance of a weighted sum of variables. It's simpler to use other software tools like the R emmeans package or the linearHypothesis() function in the car package.

The anova() output evaluates the overall association of the predictor or interaction with outcome. For example, the single anova() report for AGE_CAT is for the combined association of all levels of that predictor with outcome, while the 2 individual coefficients reported in the first display are for differences in outcome associated with each, versus the reference level. You should be aware that there are different types of anova() that can give different results. See this page for an introduction.

$\endgroup$
0
$\begingroup$

I had a similar question in this post and answered my question. Please review it for further explanation.

You can use car::Anova function:

Anova(model5, type = 3)

If an interaction exist (for example, LOCKDOWN * SEX), you can use emmeans function to detect difference:

emmeans(model5, pairwise ~ LOCKDOWN * SEX, adjust = "bonferroni", mode = "linear.predictor", type = "Score")
$\endgroup$
4
  • 1
    $\begingroup$ For this situation, I might suggest instead doing emm.ls <- emmeans(model5, ~ LOCKDOWN * SEX), then confint(emm.ls) and pairs(emm.ls, simple = "each"). This gives you the marginal means for each combination of those factors, and pairwise comparisons of each factor at each level of the other. $\endgroup$
    – Russ Lenth
    Jul 19 at 14:31
  • $\begingroup$ @Russ Lenth It is important that this information comes from you. I will also do it on my data. Thank you. $\endgroup$
    – Ertan
    Jul 19 at 19:46
  • $\begingroup$ @RussLenth I did your suggestion on my data containing interaction between group and time with repeated measures: pairs(emm, simple = "group"). However, I obtained different results from this way: emm <- emmeans(model, pairwise ~ group * time, adjust = "bonferroni"). What causes this difference? $\endgroup$
    – Ertan
    Jul 21 at 19:54
  • $\begingroup$ Because they are different comparisons. I never said you would get the same result. I suggested doing this instead, because the interpretation is clearer. $\endgroup$
    – Russ Lenth
    Jul 21 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.