1 Modeling change Kristin Sainani Ph.D. Stanford University Department of Health Research and Policy
2 Within vs. Between subject effects… Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept time chem Example 1: last week’s example. CHEM: A significant chemical effect (time-dependent predictor) could either represent a between-subjects effect or a within-subjects effect. Because these data were made-up, we happened to know that there was primarily a within-subjects effect…
3 Example 1..from last time… id time1 time2 time3 time4 chem1 chem2 chem3 chem patients with depression are given a drug that increases levels of a “happy chemical” in the brain. At baseline, all 6 patients have similar levels of this happy chemical and scores >=14 on a depression scale. Researchers measure depression score and brain-chemical levels at three subsequent time points: at 2 months, 3 months, and 6 months post-baseline. Here are the data in broad form:
4 Example 2… Same as example 1, but made up to have more between-subjects effect than within-subjects effect. id time1 time2 time3 time4 chem1 chem2 chem3 chem
5 Example 3… Same as example 1, but made up to have ONLY between-subjects effect id time1 time2 time3 time4 chem1 chem2 chem3 chem
Example 2 (more between-subjects effects): showing two subjects… id=1: score id=2: chem id=1: chem id=2: score
Example 2:
Example 3:all between-subjects effects
Example 3:
19 Results, example 1… Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept chem time Example 1: significant chem effect. CHEM: proc mixed data=hrp262.long2; model score=chem time / solution; random int/subject=id; run;
20 Results, example 2… Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept <.0001 chem time Example 2: significant chem effect CHEM: proc mixed data=hrp262.long2; model score=chem time / solution; random int/subject=id; run;
21 Results, example 3… The Mixed Procedure Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept <.0001 chem <.0001 time Example 3: significant chem effect CHEM: proc mixed data=hrp262.long3; model score=chem time / solution; random int/subject=id; run;
22 All three examples give the same result… There’s no way to tell if change in chemical levels is causing change in depression score (which is what we probably care about). What to do?...
23 Options Examine graphs! Evaluate baseline relationship of chemical1 and score1 using regular linear regression Here, you will find a strong relationship only in examples 2 and 3, suggesting strong between- subjects effects. Drawback: you still can’t rule out within-subjects effects (could have both) Use only baseline value of chemical (chem1) as a predictor in GEE or Mixed and add a time*chem1 interaction to the model to evaluate change. Here, you will find that chem1 main effect is significant but chem1*time is not in examples 2 and 3 Drawback: A significant time*chem1 interaction would indicate that baseline chemical levels predict change in depression score over time, which is slightly different than saying that change in chemical level predicts change in depression score. Correlate change in time-dependent predictor with change in repeated-measures outcome… Calculate overall change or percent change in outcome and regress this on overall change or percent change in the predictor: see chapter 8 of Twisk (2 time points only) OR model all the changes together (vector of changes)…
24 The change model
25 SAS code to change data… data hrp262.change; set hrp262.broad; time=0; ctime=2; cscore=time2-time1; cchem=chem2-chem1; output; time=1; ctime=1; cscore=time3-time2; cchem=chem3-chem2; output; time=2; ctime=3; cscore=time4-time3; cchem=chem4-chem3; output; label cchem='change in chemical'; label cscore='change in depression score'; run;
id cscore cchem time id time1 time2 time3 time4 chem1 chem2 chem3 chem So, look at change in depression score as your outcome variable. All time- dependent predictors also get a change score.
27 Example 1: naïve linear regression cscore = *cchem
28 Example 2: naïve linear regression cscore = *cchem
29 Example 3: naïve linear regression cscore = *cchem
30 Modeling changes (mixed)… EXAMPLE 1 : Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept time cchem EXAMPLE 2: Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept time cchem EXAMPLE 3: Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept time cchem
31 Modeling changes (GEE)… EXAMPLE 1: Analysis Of GEE Parameter Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept time cchem <.0001 EXAMPLE 2: Analysis Of GEE Parameter Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept time cchem EXAMPLE 3: Analysis Of GEE Parameter Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept cchem time
32 The change model In fact, it often turns out that the changes are not correlated within subjects (we’ve essentially already corrected for between subject variability by using change scores). e.g., just regular old linear regression, where each person contributes three “independent” observations…
33 The change model If time intervals are unequal and unbalanced, you might choose to include the change in time as a predictor in the model. Otherwise, you could face confounding by the time between measurements (which might be correlated with the time-dependent predictor)…
34 References Jos W. R. Twisk. Applied Longitudinal Data Analysis for Epidemiology: A Practical Guide. Cambridge University Press, 2003.