You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vignettes/practical_context_effect.Rmd
+59-2Lines changed: 59 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -181,11 +181,68 @@ This pairwise comparison table adds a crucial statistical caveat to our visual a
181
181
182
182
However, looking at the statistics, we can see that none of the differences between the time points are statistically significant (all p-values = 0.183).
183
183
184
+
This lack of significant differences between time points is not surprising, as our model assumes a *strictly linear time trend*. Under a linear assumption, the rate of change (the slope) is constrained to be constant from one time point to the next. These point-to-point comparisons would only differ if we had modeled time non-linearly (e.g., by adding a quadratic term).
185
+
186
+
Therefore, to test whether the context effect meaningfully changes over time in a linear model, it is more appropriate to evaluate the overall average contrast of the slopes across the entire study period. To do this, we calculate the contrast between the within- and between-effects without stratifying by time.
The highly significant overall contrast (2.31, p < .001) confirms that a substantial context effect is at play throughout the entire observation period.
195
+
196
+
In clinical terms, while an acute, temporary spike in psychological symptoms (the within-effect) definitely harms a patient's quality of life, carrying a chronically high baseline burden (the between-effect) takes a significantly heavier toll. A patient who generally suffers from high psychological distress faces an overarching "trait penalty" that consistently depresses their quality of life more severely than mere day-to-day fluctuations would suggest.
197
+
198
+
# Trends of Context Effects Across Educational Levels
199
+
200
+
To explore whether socioeconomic factors influence these dynamics, we can test if the context effect varies across different educational backgrounds. A reasonable assumption might be that highly educated individuals possess more resources (cognitive, financial, or social) and thus cope better with psychological burden.
201
+
202
+
To formally test this, we extend our model to include a three-way interaction between `time`, `education`, and our centered `phq4` variables.
203
+
204
+
```{r}
205
+
mixed <- lmer(
206
+
QoL ~ time * education * (phq4_within + phq4_between) + (1 + time | ID),
207
+
data = qol_cancer
208
+
)
209
+
estimate_contrasts(mixed, c("phq4_within", "phq4_between"), by = "education")
210
+
```
211
+
212
+
The marginal contrasts analysis yields nuanced results that add an important layer to our understanding of the context effect:
213
+
214
+
-*Low Education:* The contrast (1.69) is not statistically significant (p = 0.192). For these patients, there is no meaningful difference between an acute symptom spike and a chronically high baseline. Both states depress their quality of life similarly.
215
+
-*Mid Education:* The contrast (3.92) is large and highly significant (p < .001). This group actually drives the overall context effect we observed in the previous models. For middle-educated patients, a chronically high psychological burden carries a massive additional penalty compared to a temporary acute spike.
216
+
-*High Education:* Interestingly, the contrast reverses its sign (-1.76) but is not statistically significant (p = 0.337). This indicates that for highly educated patients, the context effect disappears entirely.
217
+
218
+
**What does this mean practically?**
219
+
220
+
The hypothesis that highly educated people "fare better" is supported here, but in a very specific, mechanistic way. While we would need to look at the main effects to see if their *absolute* Quality of Life is higher, this contrast analysis tells us how they *process* psychological burden.
221
+
222
+
Highly educated patients appear to be buffered against the specific "chronic penalty". For them, carrying a chronic baseline burden is no more destructive to their quality of life than experiencing an acute, temporary spike. They likely possess the resources needed to manage a chronic psychological load without letting it compound into an overarching environmental penalty.
223
+
224
+
Conversely, the middle-educated group represents a highly vulnerable population regarding these dynamics. They suffer disproportionately from a chronically high baseline burden.
225
+
226
+
# Are the Trends of Context Effects Significantly Different Between Groups?
227
+
228
+
In the previous step, we observed that the context effect seemed to be entirely driven by the middle-educated group, while highly educated patients appeared to be buffered against it. However, to rigorously test whether the size of the context effect is statistically different *between* these groups, we need to compute pairwise comparisons across the educational levels.
229
+
230
+
We can do this by adding the grouping variable (`education`) as a third term to our contrast statement.
The output now displays the mathematical difference in the size of the context effect between two specific groups.
237
+
238
+
-*Mid vs. Low (p = 0.154) & High vs. Low (p = 0.124):* The differences involving the low-education group are not statistically significant. The confidence intervals are quite wide, suggesting high variance or a smaller sample size within this specific intersection of the data.
239
+
-*High vs. Mid (Difference = -5.69, p = 0.005):* This is the crucial finding. The context effect for the highly educated group is significantly smaller (by 5.69 points) than for the middle-educated group.
240
+
184
241
**What does this mean practically?**
185
242
186
-
Although our previous analysis showed the context effect becoming locally significant at Time 2 and Time 3, and descriptively appearing to grow, we do not have enough statistical evidence to claim that the context effect changes over time. The widening gap we observed is not robust enough to rule out random sampling variation.
243
+
This pairwise comparison formally solidifies our previous suspicion: The buffering effect of higher education is statistically robust.
187
244
188
-
Therefore, the most accurate conclusion is that the "penalty" of having a chronically high baseline burden (the context effect) is consistently present across the later stages of the study, but its magnitude remains relatively stable rather than strictly worsening over time.
245
+
It proves that the "chronic penalty" for long-term psychological burden does not hit everyone equally. The structural or psychological advantages possessed by the highly educated group (such as better access to support networks, financial stability, or coping resources) create a mathematically significant difference in how chronic distress is processed. Compared directly to the middle-educated tier—who bear the full weight of the context effect—highly educated patients are significantly better protected from the cumulative "wear and tear" of a chronically high baseline burden.
0 commit comments