2
$\begingroup$

I want to evaluate the effectiveness of a psychological intervention in a RCT. My study consists of 150 subjects. Half of them were assigned to the intervention group. They are nested within three therapists. The data consists of four measurement points for every subject. I want to modell a linear mixed model using the R nlme software. I want to predict treatment outcome by treatment condition and time. However, I found out that residuals differ across the measurement points which I assume to be heteroskedasticity. I used the following formula for testing for heteroskedasticity (sosci is my df and HLM my model):

sosci$residualsOutcome<- residuals(HLM)
sosci$abs.residualsOutcome <- abs(sosci$residualsOutcome)
sosci$residuals2Outcome <- sosci$abs.residualsOutcome^2
levene1 <- lm(residuals2Outcome ~ Time, data =sosci)
levene2 <- lm(residuals2Outcome ~ Treatment, data =sosci)
anova(levene1)
anova(levene2) 

The anova than indicated that residuals might differ between the measurement points (p<.01). Additionally, I tried to plot the residuals, I hope I used the right code:

plot(HLM)

fitted values vs residuals

The plot looks okay to me; still, I am concerned about the results of the anova. I might have misunderstood something. I was wondering wether this does matter at all as Linear mixed Models do not demand for Sphericity. I am not good at statistics at all, but I was wondering wether heteroskedasticity across measurement points could be considered to be the same as no sphericity, which would mean that I could simply ignore it.

ANother idea was to account for this problem by using the weightfunction in nlme. I thought about this correction, but it might be wrong:

HLM <- lme(outcome~ Treatment*Time, random = ~1|Therapist/subject, 
data = sosci, weights = varIdent(form = ~1|Time), 
method = "ML", na.action = na.exclude)
$\endgroup$
6
  • $\begingroup$ Please can you include the plots that indicate heteroskedasticity. $\endgroup$ Commented Dec 14, 2019 at 15:45
  • $\begingroup$ In addition to the plots asked for by @RobertLong , have you considered allowing the effect of time to be different (random) across subjects. Oftentimes with longitudinal data, this can help deal with any heteroskedasticity, especially if there is a consistent time trend. $\endgroup$
    – Erik Ruzek
    Commented Dec 14, 2019 at 18:28
  • $\begingroup$ That would be a good idea. However, my supervisor wants the analysis to be ruled out with fixed effects - except for the random intercept. $\endgroup$
    – Tomaham
    Commented Dec 14, 2019 at 20:52
  • $\begingroup$ I see. Have you run the model with the effect of time on the outcome allowed to vary across subjects? If you further use model testing (anova command in R) and have evidence it provides a better fit to the data, might they be willing to reconsider? $\endgroup$
    – Erik Ruzek
    Commented Dec 14, 2019 at 21:04
  • $\begingroup$ I am just checking it out now. Actually, I have four outcome variables, and the assumption of homoscedasticy works well for three of them. So it would be nice to leave the fixed coefficients for all of them and integrate some adjustment for the last one. Do you know about an appropriate formula? $\endgroup$
    – Tomaham
    Commented Dec 14, 2019 at 21:08

0

Your Answer

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