1 modeling change kristin sainani ph.d. kcobb stanford university department of health research and...

34
1 Modeling change Kristin Sainani Ph.D. http://www.stanford.edu/~k cobb Stanford University Department of Health Research and Policy

Upload: marlene-thompson

Post on 31-Dec-2015

227 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

1

Modeling change

Kristin Sainani Ph.D.http://www.stanford.edu/~kcobb

Stanford UniversityDepartment of Health Research and Policy

Page 2: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

2

Within vs. Between subject effects…

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

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…

Page 3: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

3

Example 1..from last time…

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

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:

Page 4: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

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 chem4

1 50 48 45 40 200 350 400 5002 22 24 18 22 900 920 805 9503 44 40 34 40 500 459 880 5004 38 34 32 34 700 770 950 8005 15 19 15 19 1000 1000 1050 10106 50 58 56 54 100 110 210 220

Page 5: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

5

Example 3…

Same as example 1, but made up to have ONLY between-subjects effect

id time1 time2 time3 time4 chem1 chem2 chem3 chem4

1 51 48 45 50 510 520 510 5252 47 43 46 45 710 720 690 6803 42 42 41 38 910 890 900 9054 31 32 31 32 1105 1110 1109 10905 26 27 26 28 1505 1505 1510 15906 19 20 21 18 1750 1600 1680 1740

Page 6: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 2 (more between-subjects effects): showing two subjects…

id=1: score

id=2: chem

id=1: chem

id=2: score

Page 7: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 2:

Page 8: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 2:

Page 9: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 2:

Page 10: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 2:

Page 11: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 2:

Page 12: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 2:

Page 13: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 3:all between-subjects effects

Page 14: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 3:

Page 15: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 3:

Page 16: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 3:

Page 17: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 3:

Page 18: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

Example 3:

Page 19: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

19

Results, example 1…

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

proc mixed data=hrp262.long2;model score=chem time / solution;random int/subject=id;run;

Page 20: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

20

Results, example 2…

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

proc mixed data=hrp262.long2;model score=chem time / solution;random int/subject=id;run;

Page 21: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

21

Results, example 3…

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

proc mixed data=hrp262.long3;model score=chem time / solution;random int/subject=id;run;

Page 22: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

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?...

Page 23: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

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)…

Page 24: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

24

...

34

23

12

34

23

12

10

chemchem

chemchem

chemchem

scorescore

scorescore

scorescore

The change model

Page 25: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

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;

Page 26: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

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

id time1 time2 time3 time4 chem1 chem2 chem3 chem4

1 51 48 45 50 510 520 510 5252 47 43 46 45 710 720 690 6803 42 42 41 38 910 890 900 9054 31 32 31 32 1105 1110 1109 10905 26 27 26 28 1505 1505 1510 15906 19 20 21 18 1750 1600 1680 1740

So, look at change in depression score as your outcome variable.

All time-dependent predictors also get a change score.

Page 27: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

27

Example 1: naïve linear regression

cscore = -0.126817 - 0.011357*cchem

Page 28: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

28

Example 2: naïve linear regression

cscore = -0.167511 - 0.012043*cchem

Page 29: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

29

Example 3: naïve linear regression

cscore = -0.268792 - 0.004044*cchem

Page 30: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

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

Page 31: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

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 EstimatesStandard 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

Page 32: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

32

ErrorCORRtime

chemchem

chemchem

chemchem

scorescore

scorescore

scorescore

)(

34

23

12

34

23

12

210

The change model

ititit Errortchemscore )()( 210

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…

Page 33: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

33

The change model

itiitit Errortchemscore )()( 210

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)…

Page 34: 1 Modeling change Kristin Sainani Ph.D. kcobb Stanford University Department of Health Research and Policy kcobb

34

References Jos W. R. Twisk. Applied Longitudinal Data Analysis for Epidemiology: A

Practical Guide. Cambridge University Press, 2003.