1 / 34

Modeling change

Modeling change. Kristin Sainani Ph.D. http://www.stanford.edu/~kcobb Stanford University Department of Health Research and Policy. Within vs. Between subject effects….

ronnie
Download Presentation

Modeling change

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Modeling change Kristin Sainani Ph.D.http://www.stanford.edu/~kcobbStanford UniversityDepartment of Health Research and Policy

  2. Within vs. Between subject effects… 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… Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept 38.1287 4.1727 5 9.14 0.0003 time -0.08163 0.3234 16 -0.25 0.8039 chem -0.01283 0.003125 16 -4.11 0.0008 Example 1: last week’s example. CHEM: -.01283

  3. id time1 time2 time3 time4 chem1 chem2 chem3 chem4 1 20 18 15 20 1000 1100 1200 1300 2 22 24 18 22 1000 1000 1005 950 3 14 10 24 10 1000 1999 800 1700 4 38 34 32 34 1000 1100 1150 1100 5 25 29 25 29 1000 1000 1050 1010 6 30 28 26 14 1000 1100 1109 1500 Example 1..from last time… 6 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. id time1 time2 time3 time4 chem1 chem2 chem3 chem4 1 50 48 45 40 200 350 400 500 2 22 24 18 22 900 920 805 950 3 44 40 34 40 500 459 880 500 4 38 34 32 34 700 770 950 800 5 15 19 15 19 1000 1000 1050 1010 6 50 58 56 54 100 110 210 220 Example 2… • Same as example 1, but made up to have more between-subjects effect than within-subjects effect.

  5. id time1 time2 time3 time4 chem1 chem2 chem3 chem4 1 51 48 45 50 510 520 510 525 2 47 43 46 45 710 720 690 680 3 42 42 41 38 910 890 900 905 4 31 32 31 32 1105 1110 1109 1090 5 26 27 26 28 1505 1505 1510 1590 6 19 20 21 18 1750 1600 1680 1740 Example 3… • Same as example 1, but made up to have ONLY between-subjects effect

  6. Example 2 (more between-subjects effects): showing two subjects… id=1: score id=2: chem id=2: score id=1: chem

  7. Example 2:

  8. Example 2:

  9. Example 2:

  10. Example 2:

  11. Example 2:

  12. Example 2:

  13. Example 3:all between-subjects effects

  14. Example 3:

  15. Example 3:

  16. Example 3:

  17. Example 3:

  18. Example 3:

  19. Results, example 1… procmixeddata=hrp262.long2; model score=chem time / solution; random int/subject=id; run; Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept 38.1287 4.1727 5 9.14 0.0003 chem -0.01283 0.003125 16 -4.11 0.0008 time -0.08163 0.3234 16 -0.25 0.8039 Example 1: significant chem effect. CHEM: -.01283

  20. Results, example 2… procmixeddata=hrp262.long2; model score=chem time / solution; random int/subject=id; run; Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept 52.0159 4.2057 5 12.37 <.0001 chem -0.02644 0.005403 16 -4.89 0.0002 time 0.1009 0.2966 16 0.34 0.7381 Example 2: significant chem effect CHEM: -.02644

  21. Results, example 3… procmixeddata=hrp262.long3; model score=chem time / solution; random int/subject=id; run; The Mixed Procedure Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept 60.8810 2.4237 5 25.12 <.0001 chem -0.02354 0.002066 16 -11.39 <.0001 time -0.08592 0.1707 16 -0.50 0.6217 Example 3: significant chem effect CHEM: -.02354

  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;

  26. id time1 time2 time3 time4 chem1 chem2 chem3 chem4 1 51 48 45 50 510 520 510 525 2 47 43 46 45 710 720 690 680 3 42 42 41 38 910 890 900 905 4 31 32 31 32 1105 1110 1109 1090 5 26 27 26 28 1505 1505 1510 1590 6 19 20 21 18 1750 1600 1680 1740 id cscore cchem time 1 -3 10 1 1 -3 -10 2 1 5 15 3 2 -4 10 1 2 3 -30 2 2 -1 -10 3 3 0 -20 1 3 -1 10 2 3 -3 5 3 4 1 5 1 4 -1 -1 2 4 1 -19 3 5 1 0 1 5 -1 5 2 5 2 80 3 6 1 -150 1 6 1 80 2 6 -3 60 3 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 = -0.126817 - 0.011357*cchem

  28. Example 2: naïve linear regression cscore = -0.167511 - 0.012043*cchem

  29. Example 3: naïve linear regression cscore = -0.268792 - 0.004044*cchem

  30. Modeling changes (mixed)… EXAMPLE 1: Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept 0.3407 1.6018 5 0.21 0.8400 time -0.4669 1.2298 10 -0.38 0.7122 cchem -0.01136 0.002336 10 -4.86 0.0007 EXAMPLE 2: Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept -0.04810 1.6106 5 -0.03 0.9773 time -0.1151 1.2225 10 -0.09 0.9269 cchem -0.01218 0.006324 10 -1.93 0.0830 EXAMPLE 3:Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept -0.8621 0.9697 5 -0.89 0.4147 time 0.6023 0.7825 10 0.77 0.4592 cchem -0.00807 0.01334 10 -0.60 0.5587

  31. Modeling changes (GEE)… EXAMPLE 1: Analysis Of GEE Parameter Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept 0.3407 1.2757 -2.1596 2.8409 0.27 0.7894 time -0.4669 1.2698 -2.9557 2.0219 -0.37 0.7131 cchem -0.0114 0.0011 -0.0136 -0.0091 -9.93 <.0001 EXAMPLE 2: Analysis Of GEE Parameter Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept -0.0481 1.6245 -3.2320 3.1358 -0.03 0.9764 time -0.1151 1.2030 -2.4728 2.2427 -0.10 0.9238 cchem -0.0122 0.0050 -0.0219 -0.0024 -2.45 0.0143 EXAMPLE 3:Analysis Of GEE Parameter Estimates Standard 95% Confidence Parameter Estimate Error Limits Z Pr > |Z| Intercept -0.7146 1.5997 -3.8498 2.4207 -0.45 0.6551 cchem 0.0060 0.0112 -0.0160 0.0280 0.53 0.5955 time 0.2118 0.8366 -1.4280 1.8516 0.25 0.8000

  32. 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). The change model 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.

More Related