Hi, I would like some help with testing the difference between the levels of the interaction term in two of my models
Model 1: y ~ sex*rank + age + (1|a) + (1|b)
Here, sex has two levels (M,F) and rank has 3 levels (l,m,h), age is continuous.
Model output
Intercept
age
sexM
rankl
rankm
sexM:rankl
sexM:rankm
If want to test sexF:rankl - sexF:rankm, sexF:rankl - sexF:rankh, sexF:rankm - sexF:rankh and sexM:rankl - sexM:rankm, sexM:rankl - sexM:rankh, sexM:rankm - sexM:rankh, how can this be done using hypothesis()?
Model2: y ~ ageclass + age^2class + class + (1|a) + (1|b)
Here, age is continuous and class has 3 levels (K,M,O)
Model output
Intercept
age
age^2
classM
classO
age:classM
age:classO
age^2:classM
age^2:classO
If I want to test whether there is a difference among K,M,O in the age effect, how can this be done? (age:classK - age:classM, age:classK - age:classO, age:classM - age:classO)
How to take into account the linear and quadratic effects of age when testing these differences?
All the categorical predictors were treated as factors and were dummy coded by R.
I would really appreciated some help in figuring this out. So far I have used emmeans for the contrasts, but I would like to try use the hypothesis() function and would like to know whether there are other ways of doing it using the brms package.