91
Ph.d. course in “Advanced statistical analysis of epidemiological studies” Causal inference www.biostat.ku.dk/~pka/avepi17 Upcoming book by Hernan and Robins: http://www.hsph.harvard.edu/faculty/miguel-hernan/causal-inference- book/ 1 December 2017 Per Kragh Andersen 1

Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Ph.d. course in “Advanced statisticalanalysis of epidemiological studies”

Causal inference

www.biostat.ku.dk/~pka/avepi17

Upcoming book by Hernan and Robins:

http://www.hsph.harvard.edu/faculty/miguel-hernan/causal-inference-book/

1 December 2017

Per Kragh Andersen

1

Page 2: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Overview

• Randomized versus observational studies

• Causal effects: counterfactuals, randomized studies

• Observational studies: causal effects by the g-formula

• Observational studies: causal effects by Inverse Probability ofTreatment Weighting (IPTW, ‘propensity score’)

• More on propensity score (paper by Kurth et al.)

2

Page 3: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Randomized experiments

• In a randomized experiment: treatment allocation (A) is decidedby a ‘flip of a coin’.

• Randomization may depend on prognostic variables (sex,hospital): stratified (or ‘conditional’) randomization.

• Randomization eliminates confounding: distribution of treatment(‘exposure’) is independent of prognostic factors (L) (at least insufficiently large trials).

• Randomization balances all (known and unknown) risk factors.

• A randomized trial has a set of inclusion criteria (e.g., based onage, and often pregnant women or people with certain chronicdiseases are not included).

3

Page 4: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies

• In an observational study: exposure allocation is not randomized.

• This means that the association between exposure (A) andoutcome (Y ) may be confounded: prognostic factors (L) may beunevenly distributed among exposed and unexposed.

• Adjustment for (known - NB!) confounders is often done using aregression model

We have an idea that randomized studies allow for a causalinterpretation not shared by observational studies (‘association is nocausation’) but a precise definition of causality is needed.

4

Page 5: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

CounterfactualsMost current approaches to causality use so-called counterfactuals (orpotential outcomes) discussed, e.g., by Neyman (1923) and Rubin(1974).

The idea is that each subject, i in the target population has twopotential outcomes:

Y ia=0 = the outcome if given treatment a = 0,

Y ia=1 = the outcome if given treatment a = 1.

At least one is counterfactual and will never be realized, since ireceives at most one of the treatments.

Another approach to causal inference is based on Pearl’s ‘do-calculus’.

5

Page 6: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Causal effectsThe individual causal effect is:

Y ia=1 − Y i

a=0.

This can never be observed or estimated. Instead, focus on averagecausal effect:

ACE = E(Ya=1 − Ya=0) = E(Ya=1)− E(Ya=0).

Here, E(...) is short for expectation, the ‘average value over the targetpopulation’. Note that:

• E(Ya=1) is the average outcome if every one in the targetpopulation was given treatment a = 1

• E(Ya=0) is the average outcome if every one in the targetpopulation was given treatment a = 0

• ACE depends on the target population over which the average istaken

6

Page 7: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Figure from Hernan and Robins

7

Page 8: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Other measures of causal effectsIf the outcome is binary then E(Ya=0) is the average risk, say p0, inthe population if every one was given treatment a = 0.

Define p1 similarly. Then

p1

p0, respectively,

p1/(1− p1)

p0/(1− p0)

is the causal risk ratio, causal odds ratio, respectively.

In particular, the risks could refer to a fixed follow-up time, e.g. 1 year,in a follow-up study.

8

Page 9: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Greek gods and godesses‘Example’ from Hernan & Robins.

• 20 members of the ‘olympic family’

• In principle, each could represent 1000 (i.e., there would be norandom variation)

• a = 1 means heart transplantation, a = 0 means none

• Y means dead

• From the table next slide, we see that

ACE =10

20− 10

20= 0.

• But we never observe both Ya=0 and Ya=1 - see second table

9

Page 10: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Ya=0 Ya=1

Rheia 0 1

Kronos 1 0

Demeter 0 0

Hades 0 0

Hestia 0 0

Poseidon 1 0

Hera 0 0

Zeus 0 1

Artemis 1 1

Apollo 1 0

Leto 0 1

Ares 1 1

Athena 1 1

Hephaestus 0 1

Aphrodite 0 1

Cyclope 0 1

Persephone 1 1

Hermes 1 0

Hebe 1 0

Dionysus 1 010

Page 11: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

A Y Ya=0 Ya=1

Rheia 0 0 0 ?

Kronos 0 1 1 ?

Demeter 0 0 0 ?

Hades 0 0 0 ?

Hestia 1 0 ? 0

Poseidon 1 0 ? 0

Hera 1 0 ? 0

Zeus 1 1 ? 1

Artemis 0 1 1 ?

Apollo 0 1 1 ?

Leto 0 0 0 ?

Ares 1 1 ? 1

Athena 1 1 ? 1

Hephaestus 1 1 ? 1

Aphrodite 1 1 ? 1

Cyclope 1 1 ? 1

Persephone 1 1 ? 1

Hermes 1 0 ? 0

Hebe 1 0 ? 0

Dionysus 1 0 ? 011

Page 12: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Causality and randomized trialsWhy can we estimate ACE in a randomized trial?

Intuitively, the observed average

Y1 =1

n1

∑i:Ai=1

Yi

over those n1 patients who were randomized to A = 1 estimates theaverage E(Ya=1) we would see if every one was given treatment 1(because those who were randomized to treatment 1 constitute acompletely random subset of the target population). Similarly fortreatment 0.

We are happy with this intuition but a formal proof is not too difficult(and does illustrate the kind of assumptions we will need later whendealing with observational data).

12

Page 13: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Causality and randomized trials: formal argument

The observed average Y1 estimates E(Y | A = 1). This equals

E(Ya=1 | A = 1)

because of consistency - what we see (Yi) if person i receives treatment 1 (that is, whenAi = 1) is his or her potential outcome Y i

a=1. Assumption/‘obvious’? Further,

E(Ya=1 | A = 1) = E(Ya=1)

because of exchangeability - the potential outcome Ya is independent of treatmentallocation A: E(Ya=1 | A = 1) = E(Ya=1 | A = 0)

what we would see if randomized to treatment 1 is (on average) the same among thosewho did receive A = 1 and those who did receive A = 0 (because of randomization).

Here, as above, E(Y | A = 1) denotes the average Y for those given treatment A = 1

(the conditional mean of Y given A = 1).

Similar arguments apply of course for Y0.

13

Page 14: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Causality and stratified randomized trialsIn a stratified randomized experiment separate randomization isperformed within strata, e.g., L = 0 women, L = 1 men. Allocationprobabilities are typically the same in all strata but they need not be.

Data: outcome Yi for persons from each of the cells:

No. of persons Exposure

Confounder A = 0 A = 1

L = 0 a b m0

L = 1 c d m1

n0 n1 n

If allocation probabilities are the same then a/c ≈ b/d (samedistribution of L among treated and untreated) but m0 6= m1

(numbers of eligible male and female patients could be different).

14

Page 15: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Average outcomes in table cells:

Averages Exposure

Confounder A = 0 A = 1

L = 0 Y00 =∑

00 Yi

a Y01 =∑

01 Yi

b

L = 1 Y10 =∑

10 Yi

c Y11 =∑

11 Yi

d

What would we estimate the average of Y to be in the population ifall were

• Untreated? : 1n (m0Y00 +m1Y10) = Y ∗0 ;

• Treated? : 1n (m0Y01 +m1Y11) = Y ∗1 .

This, intuitively, leads to estimating ACE by

ACE = Y ∗1 − Y ∗0and a formal argument is not too hard.

15

Page 16: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Causality and stratified randomized trials: formal argumentWe want E(Ya=1), the average outcome if every one was giventreatment 1. An average can always be calculated in two steps:

1. First calculate the average E(Ya=1 | L) in subgroups given by L(i.e., for men and women separately),

2. then average over the L-subgroups: EL

(E(Ya=1 | L)

).

Because of exchangeability within L-subgroups (stratifiedrandomization) E(Ya=1 | L) = E(Ya=1 | L,A = 1) (within both menand women, those who get one treatment and those who get the otherare similar).

This can be stated formally as (Ya=0, Ya=1)⊥A | L: within L−groups,treatment is independent of everything, including the potentialoutcomes.

16

Page 17: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

To relate the counterfactual outcomes and the observed ones we needconsistency:

Y ia = Yi if Ai = a.

What we see (Yi) in subject i if he or she actually gets the treatmentgiven by Ai = a is the same (Y i

a ) as we would see, if subject i wasrandomized to receive treatment a.

By consistency we have E(Ya=1 | L,A = 1) = E(Y | L,A = 1) whichis estimated by Y01 for women and by Y11 for men.

These two averages should then be averaged over the sex distributionin the population:

women m0

n , men m1

n

leading to the overall average 1n (m0Y01 +m1Y11).

Similar arguments apply of course to E(Ya=0).

17

Page 18: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Causality and stratified randomized trials: notes

• We could do the same if L had several levels,

• in particular, if L was a cross-classification of several factors.

• When calculating the ACE it is basically ignored if the treatmenteffects differ between men and women - only one estimate is givenfor the average treatment effect. In other words, a potentialinteraction is ignored when calculating the ACE (though thisinteraction could be studied if part of the research protocol, moreon interaction later).

• The ACE will depend on the distribution of L (the sexdistribution: women m0

n , men m1

n ) in the target population.

18

Page 19: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studiesCan we analyze data from an observational study ‘as if it was arandomized study’ and thereby estimate an ‘average causal effect’?

Such a strong interpretation will, obviously, require some assumptions(more later).

Furthermore, we need to characterize the randomized study which issupposed to mimick our observational study:

Well-defined intervention

(‘Causal’ effects of factors like sex and age are questionable.)

Additional (standard) assumption: ‘no interference’(∼‘independence’), e.g. vaccination studies.

19

Page 20: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - one binary confounder (‘sex’)Return to the ‘stratified randomization case’ but now with data froman observational study.

Data: outcome Yi for persons from each of the cells:

No. of persons Exposure

Confounder A = 0 A = 1

L = 0 a b m0

L = 1 c d m1

n0 n1 n

Here, we will no longer expect to have a/c ≈ b/d (because thepotential confounder, L is likely to be unevenly distributed in stratagiven by the exposure A). The observed sex distribution is

women m0

n , men m1

n .

20

Page 21: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - one binary confounder (‘sex’), ctd.Average outcomes in table cells:

Averages Exposure

Confounder A = 0 A = 1

L = 0 Y00 =∑

00 Yi

a Y01 =∑

01 Yi

b

L = 1 Y10 =∑

10 Yi

c Y11 =∑

11 Yi

d

What would we estimate the average of Y to be in the population ifall were

• Untreated? : 1n (m0Y00 +m1Y10) = Y ∗0 ;

• Treated? : 1n (m0Y01 +m1Y11) = Y ∗1 .

Thus our best guess on how to estimate ACE is by using

ACE = Y ∗1 − Y ∗0 .

21

Page 22: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - one binary confounder (‘sex’), ctd.Does the estimate in any respect have a ‘causal’ interpretation?

We want E(Ya=1), the average outcome if every one was giventreatment 1. An average can always be calculated in two steps:

1. First calculate the average E(Ya=1 | L) in subgroups given by L(i.e., for men and women separately),

2. then average over the L-subgroups: EL

(E(Ya=1 | L)

).

Now, we need to assume exchangeability within L-subgroups (‘nounmeasured confounders’) E(Ya=1 | L) = E(Ya=1 | L,A = 1) (that is,within both men and women, those who get one treatment and thosewho get the other are similar). For a stratified randomized study thiswas obtained by randomization.

22

Page 23: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

We still need consistency to getE(Ya=1 | L,A = 1) = E(Y | L,A = 1), which is estimated by Y01 forwomen and by Y11 for men.

These two averages are then averaged over the sex distribution in thepopulation:

women m0

n , men m1

n

leading to the overall average 1n (m0Y01 +m1Y11).

Similar arguments apply to E(Ya=0).

23

Page 24: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - more confoundersThe same arguments apply if L has several categories and/or ismultivariate:

Consider all strata given by combinations of the confounders, e.g.,

1. old men, old women, young men, young women

2. old men, manual worker, old women, manual worker, young men,manual worker, young women, manual worker, old men,non-manual worker, old women, non-manual worker, young men,non-manual worker, young women, non-manual worker

3. etc. etc.

and assume exchangeability within all such strata.

That is, sufficiently many confounders should be collected to maketreated and untreated in any given confounder stratum comparable.

24

Page 25: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Example: Greek gods and godessesL = 1 means ‘being in a critical condition’ - see next page.

A = 0 A = 1

L = 0 a = 4 b = 4 m0 = 8

a · Y00 =∑Yi = 1 b · Y01 =

∑Yi = 1

L = 1 c = 3 d = 9 m1 = 12

c · Y10 =∑Yi = 2 d · Y11 =

∑Yi = 6

E(Y | L,A) A = 0 A = 1

L = 0∑Yi/a = 0.25

∑Yi/b = 0.25

L = 1∑Yi/c = 0.67

∑Yi/d = 0.67

25

Page 26: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

L A Y

Rheia 0 0 0

Kronos 0 0 1

Demeter 0 0 0

Hades 0 0 0

Hestia 0 1 0

Poseidon 0 1 0

Hera 0 1 0

Zeus 0 1 1

Artemis 1 0 1

Apollo 1 0 1

Leto 1 0 0

Ares 1 1 1

Athena 1 1 1

Hephaestus 1 1 1

Aphrodite 1 1 1

Cyclope 1 1 1

Persephone 1 1 1

Hermes 1 1 0

Hebe 1 1 0

Dionysus 1 1 026

Page 27: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Example: Greek gods and godessesThe ‘associational risk difference’ is

Y1 − Y0 =7

13− 3

7= 0.11

and does not possess a causal interpretation because of confoundingby L:

P (L = 1 | A = 0) =3

76= P (L = 1 | A = 1) =

9

13.

Next slide: Greek gods and godesses: data with predicted outcomesunder exposure (Y ∗1 ) and non-exposure (Y ∗0 )

27

Page 28: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

L Y ∗1 Y ∗

0

Rheia 0 0.25 0.25

Kronos 0 0.25 0.25

Demeter 0 0.25 0.25

Hades 0 0.25 0.25

Hestia 0 0.25 0.25

Poseidon 0 0.25 0.25

Hera 0 0.25 0.25

Zeus 0 0.25 0.25

Artemis 1 0.67 0.67

Apollo 1 0.67 0.67

Leto 1 0.67 0.67

Ares 1 0.67 0.67

Athena 1 0.67 0.67

Hephaestus 1 0.67 0.67

Aphrodite 1 0.67 0.67

Cyclope 1 0.67 0.67

Persephone 1 0.67 0.67

Hermes 1 0.67 0.67

Hebe 1 0.67 0.67

Dionysus 1 0.67 0.6728

Page 29: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Example: Greek gods and godessesWe see that:

• Y ∗1 = 820 · 0.25 + 12

20 · 0.67 = 0.5

• Y ∗0 = 820 · 0.25 + 12

20 · 0.67 = 0.5

• ACE = Y ∗1 − Y ∗0 = 0

i.e., no causal effect.

29

Page 30: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - many confoundersAt the end of the day we have predicted the outcome for every person,i in the population assuming

1. i was exposed

2. i was non-exposed

That is, we have calculated

Y ∗1 = 1n

∑i E(Yi | Li, Ai = 1) and Y ∗0 = 1

n

∑i E(Yi | Li, Ai = 0).

This is known as the ‘g-formula’ and is similar to directstandardization. The difference ACE = Y ∗1 − Y ∗0 can be interpretedas an average causal effect under assumptions of no unmeasuredconfounders and positivity. The latter means that for each L-categorythere should be a positive chance of seeing both exposed andnon-exposed persons.

30

Page 31: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

The g-formula

The g-formula is ACE = Y ∗1 − Y ∗0 with

Y ∗1 = 1n

∑i E(Yi | Li, Ai = 1) and Y ∗0 = 1

n

∑i E(Yi | Li, Ai = 0).

To use this in practice, we must fit a ‘Q-model’ to our data, i.e. amodel which relates the outcome Yi to exposure Ai and confoundersLi = (Li1, . . . , Lip). This could be a

• logistic regression model for a binary Y

• linear regression model for a quantitative Y

• Cox (or Fine-Gray) model for the failure probability at time t for apossibly censored outcome Y (with competing risks)

Confidence intervals for ACE can be obtained using so-calledbootstrap (more later).

31

Page 32: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Marginal structural modelsThe resulting ACE can be thought of as estimating the parameter β1

in the marginal structural model (MSM):

E(Ya) = β0 + β1a.

It is called ‘structural’ because it is a model for the potential outcomesand ‘marginal’ because it describes the marginal mean of Ya.

Note that treatment a need not be binary.

32

Page 33: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Example from Hernan and Robins: The NHEFS studyNational Health and Nutrition Examination Survey Data IEpidemiologic Follow-up Study.

• Data from 1566 smokers,

• aged 25-74 years,

• baseline exam in the 70’s,

• follow-up exam ∼10 years later,

• 403 quitted smoking (A = 1).

• Y is weight gain (possibly negative) between baseline andfollow-up examinations

33

Page 34: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Exercise: NHEFSSmoke quitting (qsmk) and weight gain (Y ) by sex:

qsmk= 0 qsmk= 1

sex= 0 a = 542 b = 220 m0 = 762

Y00 = 2.001 Y01 = 4.832

sex= 1 c = 621 d = 183 m1 = 804

Y10 = 1.970 Y11 = 4.156

Use the g-formula to estimate the average causal effect of qsmk on Y .

34

Page 35: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Exercise: NHEFS - solutionThe estimated average value, had every one in the population quittedsmoking (qsmk=1) is:

Y ∗1 =4.832 · 762 + 4.156 · 804

1566= 4.485

and, similarly for qsmk=0:

Y ∗0 =2.001 · 762 + 1.970 · 804

1566= 1.985

giving an ACE = 4.485− 1.985 = 2.5.

35

Page 36: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

How to use the g-formula in practice

1. Expand the data set with 3 sections below each other (see nextslide where the sections, however, are put side by side):

(a) The original data set with observed L,A, Y

(b) A data set keeping L, setting A = 0 and Y = missing

(c) A data set keeping L, setting A = 1 and Y = missing

2. Fit the Q-model to the data (only part 1 will be used)

3. Based on the Q-model, predict Y from L,A in the second andthird sections

4. Average the predicted outcomes separately in sections 2 and 3

36

Page 37: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Section 1: Original data Section 2: A := 0 Section 3: A := 1

L A Y L A Y L A Y

Rheia 0 0 0 0 0 . 0 1 .

Kronos 0 0 1 0 0 . 0 1 .

Demeter 0 0 0 0 0 . 0 1 .

Hades 0 0 0 0 0 . 0 1 .

Hestia 0 1 0 0 0 . 0 1 .

Poseidon 0 1 0 0 0 . 0 1 .

Hera 0 1 0 0 0 . 0 1 .

Zeus 0 1 1 0 0 . 0 1 .

Artemis 1 0 1 1 0 . 1 1 .

Apollo 1 0 1 1 0 . 1 1 .

Leto 1 0 0 1 0 . 1 1 .

Ares 1 1 1 1 0 . 1 1 .

Athena 1 1 1 1 0 . 1 1 .

Hephaestus 1 1 1 1 0 . 1 1 .

Aphrodite 1 1 1 1 0 . 1 1 .

Cyclope 1 1 1 1 0 . 1 1 .

Persephone 1 1 1 1 0 . 1 1 .

Hermes 1 1 0 1 0 . 1 1 .

Hebe 1 1 0 1 0 . 1 1 .

Dionysus 1 1 0 1 0 . 1 1 .37

Page 38: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

SAS code: g-formula

data greekgods;

input name $ L A Y;

datalines;

... DATA HERE ...

;

run;

data triple; set greekgods;

interv=-1; output;

interv=0; A=0; Y=.; output;

interv=1; A=1; Y=.; output;

run;

38

Page 39: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

SAS code, ctd.

proc genmod data=triple;

model y=a l a*l;

output out=preddata predicted=p;

run;

proc means data=preddata mean;

class interv;

var p;

run;

39

Page 40: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

R code

id<-c("Rheia", "Kronos", "Demeter", "Hades", "Hestia", "Poseidon",

"Hera", "Zeus", "Artemis", "Apollo", "Leto", "Ares", "Athena",

"Hephaestus", "Aphrodite", "Cyclope", "Persephone", "Hermes",

"Hebe", "Dionysus")

N <- length(id)

idno=1:20

L<-c(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)

A<-c(0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1)

Y<-c(0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0)

dat_greek_gods=data.frame(cbind(idno,L,A,Y))

40

Page 41: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

R code## G-formula

interv <- rep(-1, N)

observed <- cbind(L, A, Y, interv)

untreated <- cbind(L, rep(0, N), rep(NA, N), rep(0, N))

treated <- cbind(L, rep(1, N), rep(NA, N), rep(1, N))

data <- as.data.frame(rbind(observed, untreated, treated))

data$id <- rep(id, 3)

# Estimates

glm.obj <- glm(Y~ A*L, data = data)

summary(glm.obj)

data$meanY <- c(predict(glm.obj, data, type = "response"))

with(data, tapply(meanY, interv, mean))

41

Page 42: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

ExerciseThis exercise uses the NHEFS data from Hernan and Robins, see thefile ’nhefs.txt’ with 1567 lines (first line contains variable names)and the following variables:

• id: person id

• wt8271: weight gain (kgs) 1971-82

• qsmk: QUIT SMOKING BETWEEN 1ST QUESTIONNAIRE AND1982, 1:YES, 0:NO

• sex: 0: MALE 1: FEMALE

• race: 0: WHITE 1: BLACK OR OTHER

• age: at baseline (years)

• education: LEVEL OF EDUCATION IN 1971, 1: 8TH GRADEOR LESS, 2: HS DROPOUT; 3: HS, 4: COLLEGE DROPOUT,5: COLLEGE OR MORE

42

Page 43: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

• smokeintensity: NUMBER OF CIGARETTES SMOKED PERDAY IN 1971

• smokeyrs: years smoked

• exercise: IN RECREATION, HOW MUCH EXERCISE? IN 1971,0:much exercise,1:moderate exercise,2:little or no exercise

• active: IN YOUR USUAL DAY, HOW ACTIVE ARE YOU? IN1971, 0:very active, 1:moderately active, 2:inactive, 3:missing

• wt71: weight (kgs) in 1971

• ht: height (cms)

Estimate the average causal effect of quitting smoking on wt8171

using the g-formula.

43

Page 44: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - one binary confounder, revisited.Average outcomes in table cells:

Averages Exposure

Confounder A = 0 A = 1

L = 0 Y00 =∑

00 Yi

a Y01 =∑

01 Yi

b

L = 1 Y10 =∑

10 Yi

c Y11 =∑

11 Yi

d

What would we estimate the average of Y to be in the population ifall were

• Untreated? : 1n (m0Y00 +m1Y10) = Y ∗0 ;

• Treated? : 1n (m0Y01 +m1Y11) = Y ∗1 .

Thus our best guess on how to estimate ACE is by using

ACE = Y ∗1 − Y ∗0 .

44

Page 45: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - IPTWSince Y00 =

∑00

Yi

a and Y10 =∑

10Yi

c , the average

Y ∗0 =1

n(m0Y00 +m1Y10)

can be re-written as:

Y ∗0 =1

n(∑00

Yia/m0

+∑10

Yic/m1

),

that is, we average the outcomes for those who did receive treatment0 but each such person, i appears with a certain weight, wi. Similarly,

Y ∗1 =1

n(∑01

Yib/m0

+∑11

Yid/m1

).

45

Page 46: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - IPTWThe estimated average causal effect is then written:

ACE =

∑Treated Yiwi∑Treated wi

−∑

Untreated Yiwi∑Untreated wi

where the weight wi is

• 1a/m0

if Ai = 0, Li = 0,

• 1c/m1

if Ai = 0, Li = 1,

• 1b/m0

if Ai = 1, Li = 0,

• 1d/m1

if Ai = 1, Li = 1.

46

Page 47: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - IPTWThe weights are Inverse Probabilities of Treatment Assignment forgiven confounder level. A person is weighted with his or her (inverse)probability of receiving the actually given treatment.

The probability of receiving treatment 1 is often called the propensityscore

p(`) = P (A = 1 | L = `),

that is, a treated subject gets the weight wi = 1p(Li)

and an untreatedgets the weight wi = 1

1−p(Li).

The weights add up to n in both treatment groups:∑Untreated wi = a · 1

a/m0+ c · 1

c/m1= m0 +m1 = n,∑

Treated wi = b · 1b/m0

+ d · 1d/m1

= m0 +m1 = n.

47

Page 48: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - notes on simple case

• The re-weighted data set has twice the original size.

• Since we weight with the probabilities of treatment assignmentthese should both be > 0, ‘positivity’.

• In the re-weighted data set, the confounder has the samedistribution among treated and untreated:

‘Average number of males’:

among untreated: 1n

∑i:Ai=0

Li

c/m1= m1

n

among treated: 1n

∑i:Ai=1

Li

d/m1= m1

n

48

Page 49: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Example: Greek gods and godesses

A = 0 A = 1

L = 0 a = 4 b = 4 m0 = 8∑Yi = 1

∑Yi = 1

L = 1 c = 3 d = 9 m1 = 12∑Yi = 2

∑Yi = 6

P (A | L) A = 0 A = 1

L = 0 a/m0 = 0.5 b/m0 = 0.5

L = 1 c/m1 = 0.25 d/m1 = 0.75

Next slide: Greek gods and godesses: re-weighted data

49

Page 50: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

L A Y w

Rheia 0 0 0 1/0.5=2

Kronos 0 0 1 1/0.5=2

Demeter 0 0 0 1/0.5=2

Hades 0 0 0 1/0.5=2

Hestia 0 1 0 1/0.5=2

Poseidon 0 1 0 1/0.5=2

Hera 0 1 0 1/0.5=2

Zeus 0 1 1 1/0.5=2

Artemis 1 0 1 1/0.25=4

Apollo 1 0 1 1/0.25=4

Leto 1 0 0 1/0.25=4

Ares 1 1 1 1/0.75=4/3

Athena 1 1 1 1/0.75=4/3

Hephaestus 1 1 1 1/0.75=4/3

Aphrodite 1 1 1 1/0.75=4/3

Cyclope 1 1 1 1/0.75=4/3

Persephone 1 1 1 1/0.75=4/3

Hermes 1 1 0 1/0.75=4/3

Hebe 1 1 0 1/0.75=4/3

Dionysus 1 1 0 1/0.75=4/350

Page 51: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Example: Greek gods and godessesNote that:

•∑

i:Ai=0 wi = 4 · 2 + 3 · 4 = 20 = n,

•∑

i:Ai=1 wi = 4 · 2 + 9 · 4/3 = 20 = n.

• 1n

∑i:Ai=0 Yiwi = (1 · 2 + 2 · 4)/20 = 0.5,

1n

∑i:Ai=1 Yiwi = (1 · 2 + 6 · (4/3))/20 = 0.5,

i.e., no causal effect.

• 1n

∑i:Ai=0 Liwi = (3 · 4)/20 = 0.6,

1n

∑i:Ai=1 Liwi = (9 · (4/3))/20 = 0.6,

i.e., L is independent of A in the re-weighted data set.

51

Page 52: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Exercise: NHEFSSmoke quitting (qsmk) and weight gain (Y ) by sex:

qsmk= 0 qsmk= 1

sex= 0 a = 542 b = 220 m0 = 762

Y00 = 2.001 Y01 = 4.832

sex= 1 c = 621 d = 183 m1 = 804

Y10 = 1.970 Y11 = 4.156

Use IPTW to estimate the average causal effect of qsmk on Y andverify that, in the re-weighted data set, sex is independent of qsmk.

52

Page 53: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Exercise: NHEFS - solutionThe propensity scores are P (A = 1 | L = 0) = 220/762 for womenand P (A = 1 | L = 1) = 183/804 for men.

The weighted average for the treated (qsmk=1) is

1

1566

∑i:Ai=1

Yiwi =

220·4.832220/762 + 183·4.156

183/804

1566= 4.485

and for the untreated (qsmk=0) it is

1

1566

∑i:Ai=0

Yiwi =

542·2.001542/762 + 621·1.970

621/804

1566= 1.985.

This leads to ACE = 2.5.

53

Page 54: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

The ‘fraction’ of treated men (i.e., weighted) is

1

1566

∑i:Ai=1

Li

183/804=

1

1566

183

183/804=

804

1566

and similarly for the untreated

1

1566

∑i:Ai=0

Li

621/804=

1

1566

621

621/804=

804

1566.

54

Page 55: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - many confoundersIn practice, we are unable to estimate the probabilities of treatmentassignment using relative frequencies in all confounder strata and weneed to model the propensity score:

p(Li) = P (Ai = 1|Li1, . . . , Lip)

(typically by logistic regression). We then calculate the weightedresponses Yiwi where

• wi = 1p(Li)

if Ai = 1,

• wi = 1(1−p(Li))

if Ai = 0.

Finally, we estimate ACE by the difference between the weightedaverages:

ACE =

∑i:Ai=1 Yiwi∑i:Ai=1 wi

−∑

i:Ai=0 Yiwi∑i:Ai=0 wi

.

55

Page 56: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Formal argumentFor completeness we give the calculations showing that this estimatesACE.

Since it can be shown that∑

i:Ai=1 wi =∑

i:Ai=0 wi ≈ n, the meanof the estimate is:

1nE∑

i

(YiAi

p(Li)− Yi(1−Ai)

1−p(Li)

)= 1

nEL

∑iE(YiAi

p(Li)− Yi(1−Ai)

1−p(Li)| Li

)= 1

nEL

∑iE(Y i

a=1Ai

p(Li)− Y i

a=0(1−Ai)1−p(Li)

| Li

)= 1

nEL

∑i

(E(Y i

a=1 | Li)E( Ai

p(Li)| Li)

−E(Y ia=0 | Li)E( 1−Ai

1−p(Li)| Li)

)= 1

n

∑i

(E(Y i

a=1)− E(Y ia=0)

)= ACE.

56

Page 57: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Marginal structural modelsAs above, the resulting ACE can be thought of as estimating theparameter β1 in the marginal structural model (MSM):

E(Ya) = β0 + β1a.

The way it is done in practice is to add the relevant weight wi to eachline of the data set and fit a standard model by incorporating theweights in the analysis.

Note that treatment a need not be binary in the MSM (thoughobtaining the weights will be more tricky for non-binary a).

57

Page 58: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Marginal structural models, quantitative or binary outcomesThe standard model is typically a linear regression model for aquantitative outcome (like in the NHEFS study).

For a binary outcome the MSM could also be a linear risk model.

Alternatively (and more often), it could be a logistic regression modelin which exp(β1) is a causal odds ratio and where the causal riskdifference is

ACE =exp(β0 + β1)

1 + exp(β0 + β1)− exp(β0)

1 + exp(β0).

58

Page 59: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Marginal structural models for survival dataWhen the outcome Y is a time-to-event outcome, one may estimatethe causal t-year risk difference (ACE(t)) by fitting a marginalstructural Cox model for the hazard of Ya:

ha(t) = h0(t) exp(β1a).

This is done by fitting a Cox model to the weighted data set and,based on the estimates, by predicting

ACE(t) = 1− exp(−H0(t) exp(β1))− (1− exp(−H0(t))).

Similar techniques are available in the presence of competing risks(using marginal structural cause-specific Cox or Fine-Gray models).

59

Page 60: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Marginal structural models: confidence limits

• So-called robust standard errors may be used. However, these aresuspected to provide too wide confidence intervals.

• The method most often used is the (non-parametric) bootstrap:

1. Draw B samples of size n with replacement from the originaldata set (i.e., in each ‘bootstrap sample’ b = 1, . . . , B, somerecords appear several times and some do not appear at all).

2. Analyze each bootstrap sample (B) like we analyzed theoriginal data set, i.e. estimate propensity score weights and,subsequently, the average causal effect ACEb

3. Summarize the distribution ACE1, . . . , ACEB using, e.g., themean and SD or (preferably) using the 2.5 and 97.5 percentiles.

• In principle, the uncertainty of the ACE may also be derivedtheoretically (but this is not implemented).

60

Page 61: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

SAS-code: IPTW-analysisproc genmod data=greekgods descending;

model a=l/dist=bin;

output out=iptw predicted=propscore;

run;

data iptw; set iptw;

if a=1 then w=1/propscore; if a=0 then w=1/(1-propscore);

run;

proc genmod data=iptw;

class name;

model y=a;

repeated subject=name;

weight w;

run;

61

Page 62: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

R-code

## IPTW-analysis

fit<-glm(A~ as.factor(L),family = binomial(),data=dat_greek_gods)

summary(fit)

p.A.obs <- ifelse(dat_greek_gods$A == 0, 1 - predict(fit, type =

"response"), predict(fit, type = "response"))

dat_greek_gods$w <- 1/p.A.obs

dat_greek_gods

lm(Y~factor(A)-1, data = dat_greek_gods, weights = w)

62

Page 63: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

ExerciseThis exercise uses the NHEFS data from Hernan and Robins, see thefile ’nhefs.txt’ with 1567 lines and the previously mentionedvariables.

Estimate the average causal effect of quitting smoking on wt8171

using IPTW.

63

Page 64: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Which variables to include in the p(L) model?

• Include all confounders, i.e. common causes of A and Y .

• However, do not include variables which are just good predictorsof A

• If anything, include risk factors for Y (to improve precision)

Propensity score modeling is a somewhat unusual exercise!

64

Page 65: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Positivity, stabilized weightsWe needed positivity (0 < p(`) < 1) for the propensity score to use itfor the weights.

However, the weights may still be ‘unstable’: if p(Li) is close to 0 or 1then subject i may receive a large weight.

For that reason weights are often stabilized by replacing wi by wSi

given by

wSi =

P (Ai = 1)

p(Li)when Ai = 1, wS

i =P (Ai = 0)

1− p(Li)when Ai = 0.

That is, we multiply the weights by the marginal probabilities oftreatment. Thereby the re-weighted population has (approximately)the same size (≈ n) as the original data set and contains≈ nP (Ai = 1) treated and ≈ nP (Ai = 0) untreated.

65

Page 66: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - in generalWe have seen two approaches to causal inference

• using the g-formula

• propensity score (IPTW) weighting

These gave the same in the saturated case where a separate averagecan be calculated in each confounder category.

In general, we need some modeling, and the two approaches will differ.

66

Page 67: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Observational studies - in generalBoth methods need the same set of asumptions:

• no unmeasured confounders

• consistency

• positivity

• well-defined intervention

• (no interference)

Both need a correctly specified model for either

• Y given A and L (the ‘Q’-model)

• A given L (the propensity score model)

67

Page 68: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Which approach to use in practice?Pros and cons:

• A Q-model is a standard regression model and also givesimportant information about risk factors for Y .

• We can ask the doctor who he or she treats (i.e., (A | L)) - wecannot ask nature who will die (i.e., (Y | L))!

• If P (Y = 1) is small and P (A = 1) is not small then p(L) allowsa “richer” model, e.g. including many interactions.

• Propensity score weights may be unstable and give high variabilityif p(Li) (or 1− p(Li)) is small (use of stabilized weights:P (A = 1)/p(Li), P (A = 0)/(1− p(Li)) may help).

68

Page 69: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Which approach to use in practice?General advice:

use both!

If the results tend to agree then that is nice and somewhat reassuring(though no guarantee for ‘correctness’). If results tend to disagreethen some more scepticism should be exercised.

Alternatively (or in addition), refer to ‘double robustness’; estimationmethods have been developed that only require one of the two modelsto hold.

A simple version of this first estimates the weights, wi for IPTW, nextincludes the covariate zi = wi if Ai = 1, zi = −wi if Ai = 0 in theQ−model, and finally uses the g−formula to estimate ACE.

69

Page 70: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

ACE in subgroupsWe have focused on ACE in the total population but subgroups couldalso be relevant to consider, e.g. ACE among the treated sincecertain drugs will never be prescribed to some subjects.

Return to the average outcomes in table cells:

Averages Exposure

Confounder A = 0 A = 1

L = 0 Y00 =∑

00 Yi

a Y01 =∑

01 Yi

b

L = 1 Y10 =∑

10 Yi

c Y11 =∑

11 Yi

d

What would we estimate the average of Y to be among the treated ifall were

• Treated? : 1b+d (b · Y01 + d · Y11).

• Untreated? : 1b+d (b · Y00 + d · Y10).

70

Page 71: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

ACE among the treated: g-formulaThe ACE among the treated is the difference:

1b+d (b · Y01 + d · Y11)− 1

b+d (b · Y00 + d · Y10).

In the general case, one may use the Q−model to predict the outcome(under either treatment) only among the treated or in other subgroups.

71

Page 72: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

ACE among the treated: IPTWThe ACE among the treated is the difference:

1b+d (b · Y01 + d · Y11)− 1

b+d (b · Y00 + d · Y10)

= 1b+d (

∑01 Yi

b/b +∑

11 Yi

d/d −∑

00 Yi

a/b −∑

10 Yi

c/d )

=∑

i:Ai=1 Yiwi∑i:Ai=1 wi

−∑

i:Ai=0 Yiwi∑i:Ai=0 wi

,

where

• wi = 1 if Ai = 1

• wi = 1−P (Ai=1|Li)P (Ai=1|Li)

if Ai = 0.

These are called the ‘SMR’ weights and satisfy∑Untreated wi =

∑Treated wi = b+ d.

Such weights can also be used with many confounders.

72

Page 73: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

InteractionIn a study of possible interaction/effect-modification, stratum-specificACEs could be estimated and compared, e.g.

• ACE0 for women

• ACE1 for men

Formally, this corresponds to a marginal structural model including aninteraction between sex and a.

However, before doing this, one should be convinced of the relevanceof different average causal effects for men and women.

73

Page 74: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Notes on propensity score

• Propensity score may be used in other ways: matching,stratification, regression adjustment

• Propensity score was introduced by Rosenbaum and Rubin (1983,Biometrika) who showed that p(L) is a balancing score.

This means that for given p(L), A and L are independent:A⊥L | p(L).

This further means that if there are no unmeasured confounders,i.e., Ya⊥A | L, then it also holds that Ya⊥A | p(L).

74

Page 75: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

More on propensity scoreHow to estimate the treatment effect using p(L)?

• Use weighting to estimate ACE in total population or ACEamong the treated as discussed above

• Match on p(L), i.e. for each treated person, find an untreatedwith the same p(L) (or vice versa)

• Stratify on p(L) into a few groups and summarize using, e.g. theMantel-Haenszel method or logistic regression

• Do regression analysis of Y on A including p(L) (e.g., as aquantitative variable, linearly or non-linearly, or categorically)

However, these methods will typically differ since different parametersare estimated.

75

Page 76: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Example: Kurth et al., Amer. J. Epi., 2006“Results of multivariable logistic regression, propensity matching,propensity adjustment, and propensity-based weighting underconditions of nonuniform effect”.

In-hospital mortality in 6269 stroke patients treated (212) or nottreated with tissue plasminogen activator (t-PA), 2000-2001.

Data from Westphalian Stroke Registry, Germany.

Crude 2 by 2 table: (OR = 3.35)

Treatment t-PA Other Total

Died 34 327 361

Survived 178 5730 5908

Total 212 6057 6269

Look at distribution of pre-treatment variables:

76

Page 77: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Variable t-PA (n = 212) No (n = 6057) p value

Age (mean (SD)) 65.7 (12.5) 69.7 (13.0) < 0.01

Males 57.6 47.8 0.42

Paresis: None/unknown 8.2 32.3 < 0.01

Paresis: Monoplegia 1.9 9.1

Paresis: Hemiplegia 89.6 57.4

Paresis: Tetraplegia 0.5 1.3

Aphasia 49.5 23.1 < 0.01

State of consciousness: Awake 66.5 75.9 0.87

State of consciousness: Somnolent 24.5 10.6

State of consciousness: Comatose 0.9 2.0

State of consciousness: Unknown 8.0 11.6

Rankin scale: 1-3 (best) 5.2 32.9 < 0.01

Rankin scale: 4-5 37.3 41.8

Rankin scale: 6 (worst) 51.4 18.8

Rankin scale: Unknown 6.1 6.5

Hypertension 70.8 72.5 0.57

Atrial fibrillation 37.3 20.9 < 0.01

Heart disease 26.9 26.0 0.76

77

Page 78: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Variable t-PA (n = 212) No (n = 6057) p value

Diabetes 25.0 31.0 0.06

Other comorbidities 27.8 30.8 0.36

Previous stroke 9.4 17.5 < 0.01

Living situation: Alone 10.9 19.5 0.02

Living situation: Family 75.0 59.9

Living situation: Nursing home 1.4 4.1

Living situation:Unknown 12.7 16.5

Transport: Private 4.7 25.3 < 0.01

Transport: Emergency medical service 63.2 22.3

Transport: Other qualified 28.3 39.3

Transport: Other/unknown 3.8 13.1

Time from symptoms: <1 hour 54.3 35.5 < 0.01

Time from symptoms: 1-3 hours 40.6 15.7

Time from symptoms: >3 hours 5.2 48.8

Admitting ward: Normal 1.4 20.7 < 0.01

Admitting ward: Stroke unit 75.5 63.5

Admitting ward: Intensive care unit 18.4 4.4

Admitting ward: Unknown 4.7 11.4

78

Page 79: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Propensity score modelThe model included all of these variables plus interactions betweencalendar time (2 periods) and:

• Age (-70, 70+)

• Rankin scale at admission (’daily activity’ scale for stroke patients,2 categories: 1-5, 6)

• Time from event to hospital admission (3 categories)

79

Page 80: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Distribution of propensity scorePercentile Treated (n = 212) Not treated (n = 6057) OR

Score No. No.D % D Score No. No.D % D

99 to 100 0.5809 36 3 8.3 0.5474 26 7 26.9 0.25

95 to 99 0.3143 73 13 17.8 0.2912 178 27 15.2 1.21

90 to 95 0.1393 55 8 14.6 0.1363 258 19 7.4 2.14

75 to 90 0.0585 31 3 9.7 0.0459 910 82 9.0 1.08

50 to 75 0.0115 10 4 40.0 0.0084 1558 87 5.6 11.27

25 to 50 0.0017 5 2 40.0 0.0014 1561 54 3.5 18.60

10 to 25 0.0004 2 1 50.0 0.000267 940 36 3.8 25.11

5 to 10 0 0 0 0.000066 313 6 1.9

1 to 5 0 0 0 0.000027 251 8 3.2

0 to 1 0 0 0 0.000007 62 1 1.6

Overall 0.2521 212 34 16.0 0.0262 6057 327 5.4 3.35

80

Page 81: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Comments to table

• Strong association (obviously!) between propensity score andtreatment

• E.g., very few treated with a low score

• Mortality varies with propensity score - in opposite directions fortreated and untreated (“interaction between propensity score andtreatment”)

• ⇒ OR changes dramatically among propensity score groups

81

Page 82: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Methods of analysis1. (No adjustment)

2. Matching on propensity score

3. SMR weighted analysis

4. IPTW analysis

5. Multiple logistic regression

6. Logistic regression including propensity score:

• Quantitative variable

• Quantitative variable + a few extra variables

• Categorical variable (deciles)

• Categorical variable (deciles) + a few extra variables

7. Stratification by propensity score

First: comparison of pre-treatment variables between matched groups

82

Page 83: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Variable t-PA (n = 203) No (n = 203) p value

Age(mean (SD)) 65.6 (12.6) 66.1 (12.0) 0.69

Males 57.1 59.1 0.71

Paresis: None/unknown 8.4 14.3 0.08

Paresis: Monoplegia 2.0 2.0

Paresis: Hemiplegia 89.2 82.8

Paresis: Tetraplegia 0.5 1.0

Aphasia 48.3 50.3 0.69

State of consciousness: Awake 66.5 64.0 0.54

State of consciousness: Somnolent 24.6 25.6

State of consciousness: Comatose 1.0 1.0

State of consciousness: Unknown 7.9 9.4

Rankin scale: 1-3 5.4 9.4 0.73

Rankin scale: 4-5 37.9 37.0

Rankin scale: 6 51.2 50.3

Rankin scale: Unknown 5.4 9.4

Hypertension 71.4 73.4 0.66

Atrial fibrillation 37.0 37.0 1.00

Heart disease 26.6 30.5 0.38

83

Page 84: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Variable t-PA (n = 203) No (n = 203) p value

Diabetes 24.1 29.1 0.26

Other comorbidities 27.6 26.6 0.82

Previous stroke 9.9 11.3 0.63

Living situation: Alone 10.3 16.8 0.50

Living situation: Family 74.9 68.5

Living situation: Nursing home 1.5 2.0

Living situation: Unknown 13.3 12.8

Transport: Private 4.9 7.4 0.50

Transport: Emergency medical service 62.1 63.1

Transport: Other qualified 29.1 26.1

Transport: Other/unknown 3.9 3.9

Time from symptoms: <1 hour 54.7 54.2 0.63

Time from symptoms: 1-3 hours 39.9 37.9

Time from symptoms: >3 hours 5.4 7.9

Admitting ward: Normal 1.5 4.9 0.45

Admitting ward: Stroke unit 74.9 71.4

Admitting ward: Intensive care unit 18.7 18.2

Admitting ward: Unknown 4.9 5.4

84

Page 85: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

ResultsNo. OR 95% CI

(Crude model 6269 3.35 2.28, 4.91)

Matched on propensity score 406 1.17 0.68, 2.00

SMR weighted 6269 1.11 0.67, 1.84

IPTW weighted 6269 10.77 2.47, 47.04

Multiple regression model 6269 1.93 1.22, 3.06

Propensity score, quantitative 6269 1.53 0.95, 2.48

+ a few extra 6269 1.85 1.13, 3.03

Propensity score, deciles 6269 1.76 1.13, 2.72

+ a few extra 6269 1.96 1.20, 3.20

Stratified by Propensity score 6269 1.51 0.99, 2.32

85

Page 86: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Comments• Different parameters are estimated:

– Average causal effect in population with covariate distribution asthat among the treated

– Average causal effect in total population

– Conditional OR given covariates - NB this may be interpreted as a‘conditional causal effect’, that is, what we would see if weconducted randomized trials for all combinations of L and assumedthe same effect everywhere

• How meaningful is the average causal effect when the propensity scorestratum-specific effects vary so much?

• If we go for the conditional OR given covariates, what is then the roleof the propensity score? Stürmer et al. (J. Clin. Epi., 2005) studied theuse of propensity score in the literature 1998-2003 and found littleevidence of gain in confounder control compared to multiple regression

86

Page 87: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Results: propensity score ≥ 0.05

No. OR 95% CI

Crude model 978 1.36 0.84, 2.19

Matched on propensity score 338 0.89 0.49, 1.63

SMR weighted 978 0.82 0.47, 1.44

IPTW weighted 978 1.09 0.62, 1.93

Multiple regression model 978 1.30 0.74, 2.31

Propensity score, quantitative 978 0.99 0.58, 1.56

+ a few extra 978 1.29 0.73, 2.29

Propensity score, deciles 978 1.24 0.75, 2.03

+ a few extra 978 1.31 0.74, 2.33

Stratified by Propensity score 978 ? ?, ?

87

Page 88: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Quotations

• d’Agostino: “The propensity score should be thought of as anadditional tool available to the investigators as they try toestimate the effects of treatments in studies”

• Joffe and Rosenbaum “The propensity score complementsmodel-based procedures and is not a substitute for them”

• Senn et al. “the overwhelming and sometimes naive enthusiasmfor propensity score stratification ... should be followed by a morebalanced discussion of the pros and cons of different approaches”

• Stürmer et al. “propensity scores, like any other method, shouldnot be automatically regarded as a preferable and sole method tocontrol for confounding in nonexperimental research, but rather asa promising addition”

88

Page 89: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Topics not covered

• Instrumental variables: another approach to causal inference(‘Mendelian randomization’, non-compliance studies)

• Time-dependent confounding: when a time-dependent variable atthe same time is a confounder for the relation between atime-dependent exposure and the outcome and intermediatebetween a time-dependent exposure and the outcome, i.e. whenthere is feed-back, e.g., paper by Daniel et al. Statist. in Med.(2013), pp. 1584-1618.

• Mediation: how much of an effect of the exposure on the outcomeis ‘mediated’ through a certain variable?

89

Page 90: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

Summary

• Causal inference is a very active area of methodological research

• Absolute risks are often asked for by journal editors and theg-formula is one way to obtain such numbers

• Propensity score methods are also often asked for by journaleditors (seemingly some times without realizing that such methodscan provide quite different results)

• Classical methods (e.g., logistic or Cox regression) are crucial toolsin causal inference

• Causal interpretation relies on the untestable assumption of ‘nounmeasured confounders’

• Remember ‘meaningful interventions’

90

Page 91: Ph.d. coursein“Advancedstatistical ...publicifsv.sund.ku.dk/~pka/avepi17/causal17.pdfObservationalstudies-moreconfounders Thesameargumentsapplyif L hasseveralcategoriesand/oris multivariate:

ReferencesT.Kurth, A.M.Walker, R.J.Glynn, K.A.Chan, J.M.Gaziano, K.Berger, J.M.Robins (2005).Results of multivariable logistic regression, propensity matching, propensity adjustment andpropensity-based weighting under conditions of nonuniform effect. Amer. J. Epidemiol.163, 262-270.

P.R.Rosenbaum, D.B.Rubin (1983). The central role of the propensity score inobservational studies for causal effects. Biometrika 79, 41-55.

Stürmer, T., Joshi, M., Glynn, R.J., Avorn, J., Rothman, K.J., Schneeweiss, S. (2006). Areview of the application of propensity score methods yielded increasing use, advantages inspecific settings, but not substantially different estimates compared with conventionalmultivariable methods. J. Clin. Epi. 59, 437-447.

R.d’Agostino, Jr. (1998). Tutorial in Biostatistics: Propensity score methods for biasreduction in the comparison of a treatment to a non-randomized control group. Statist.Med. 17, 2265-2281.

M.M.Joffe, P.R.Rosenbaum (1999). Invited commentary: Propensity score. Amer. J.Epidemiol,150, 327-333.

S.Senn, E.Graf, A.Caputo (2007). Stratification for the propensity score compared with

linear regression techniques to assess the effect of treatment or exposure. Statist. Med. 26,

5529-5544.

91