0
$\begingroup$

I have a database called dat1. Each participant (id) had multiple measurements. One of the variables measures type of the stress called stress_type (acute=0, chronic =1) and another variable is the stressful level of the stressor (continuous variable 0-3).

I wanted to examine the effect of the stressor type, stressful level and interaction of type*level of stress on depression. I disentangled stress_type and stress level variables to get the within and between person mean, and calculated the within and between interaction as well.

mean_stress_type_rec = between person mean of stress type

mean_stress_level = between person mean of stress level

cent_stress_type_rec = within person mean of stress type

cent_stress_level = within person mean of stress level

I ran the following model:

res_intvsnonint_levels_int_nopleas <- lme(dep ~  mean_stress_type_rec * mean_stress_level +
 cent_stress_type_rec * cent_stress_level, 
 random = ~ cent_stress_type_rec + cent_stress_level _rec + obs_cent1 | id, data=dat1,
 na.action=na.omit,
 control=lmeControl(maxIter=1000, msMaxIter=1000, niterEM=1000, sing.tol=1e-20))

I found a very marginal interaction at the between level:

                    Coef.   SE         95% CI      t-value    p
Fixed effects                   
Intercept           29.28   4.42    20.61 – 37.96   6.62    <0.001
Time               -0.07    0.03    -0.13 – -0.01   -2.43   0.015
Type - between      4.46    6.47    -8.36 – 17.27   0.69    0.492
Type - within       0.41    0.59    -0.74 – 1.56    0.7     0.484
Level - between     2.14    2.6     -3.01 – 7.29    0.82    0.413
Level - within      0.41    0.35    -0.27 – 1.10    1.18    0.237
Type*Level - between-8.21   4.13    -16.40 – -0.03  -1.99   0.048
Type*Level - within  0.6    0.79    -0.96 – 2.16    0.76    0.448

I don't know what then I should do to further examine the between-level interaction. I'd appreciate your help.

$\endgroup$

1 Answer 1

0
$\begingroup$

In principle*, you can use emmeans emtrends for this. You need to choose a couple of "testing points" for your other continuous predictor. This is easiest if you standardize your predictors and choose for instance points -1, 0, 1 for predictor 1. This way you will be comparing predictor 2 slopes at predictor 1's levels of mean-1 SD, mean, and mean +1 SD, which I find is often reasonable way to test continuous-continuous interaction. So, first standardize your predictors, then run the model again with standardized predictors, then:

library(emmeans)
emtrends(modelname, pairwise ~ levelBetween, var = "levelWithin", at=list(levelBetween=c(-1,0,1)) 

You don't have to standardize though if you can find reasonable testing points from the predictor's raw values.

*However, I wonder about your stress type variable - can it really be understood as continuous? I understand you need to somehow get the mean value from it but I wonder what the resulting variable actually represents because it was originally categorical (?). But in principle you can use the above with a cont x cont interaction.

$\endgroup$
4
  • $\begingroup$ Thank you for your answer. If I run the model using the standardized predictors I might lose disentangling the within and between person, am I correct? The model showed only the interaction of the between-person level of both stress type and stress level was significant (mean_stress_type_rec * mean_stress_level), which is what I'd like to understand. The within-person interaction was not significant. For clarification, the between-person variable of stress type is the proportion of the chronic (vs acute) events over the study. $\endgroup$
    – MAIMAU
    Commented Apr 26, 2023 at 17:02
  • $\begingroup$ You don't have to standardize anything, you can choose suitable points from your predictor's distribution in its current form. You can use the emtrends code I provided without standardization. Just change the -1, 0, 1 into values from the range of your predictor in its current form. $\endgroup$
    – Sointu
    Commented Apr 27, 2023 at 7:05
  • $\begingroup$ (however it seems that both variables in your significant interaction are between-subjects (level 2) variables i.e., have 1 value per participant - in which case standardizing them should not do anything to your model/interpretation. It's only level 1 variables you need to keep subject-mean centered in a multilevel model. But it may be I'm missing something here) $\endgroup$
    – Sointu
    Commented Apr 27, 2023 at 7:06
  • $\begingroup$ Yes, the significant interaction is in the between-subjects level. I disentangled the within and between variance. The interaction was n.s. in the within level. That's why I'm lost regarding what I need to do in this case in which the interaction is in the between subjects level. $\endgroup$
    – MAIMAU
    Commented Apr 27, 2023 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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