Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Statistical Rethinking Fall 2017 Lecture 12

Statistical Rethinking Fall 2017 Lecture 12

Week 7, Lecture 12, Statistical Rethinking: A Bayesian Course with Examples in R and Stan. This lecture covers Chapter 10 of the book.

A0f2f64b2e58f3bfa48296fb9ed73853?s=128

Richard McElreath

December 06, 2017
Tweet

Transcript

  1. Week 7: The Generalized Linear Model Richard McElreath Statistical Rethinking

  2. Tide prediction machine, 1879 design, by William Thomson (Lord Kelvin,

    1824–1907)
  3. Generalized Linear Models • Goal: Connect linear model to outcome

    variable • Would be better to ditch linear model, too • Can model multivariate relationships and non- linear responses • Building blocks of multilevel models • Strategy: 1. Pick an outcome distribution 2. Model its parameters using links to linear models 3. Compute posterior
  4. Generalized Linear Models • (1) Pick an outcome distribution •

    Distances and durations: exponential, gamma (survival or event history) • Counts: Poisson, binomial, multinomial, geometric • Monsters: Ranks and ordered categories • Mixtures: Beta-binomial, gamma-Poisson, zero- inflated processes
  5. Generalized Linear Models • (2) Model parameters with a link

    γSJ|"J= ≈ −. + .() = . Z J ∼ /PSNBM(µJ, σ), µJ = α + β YJ + β YJ + β YJ + β YJ YJ + β YJ YJ + β YJ YJ + β YJ YJ YJ. Z J ∼ /PSNBM(µJ, σ), µJ = α + βYJ. Z J ∼ #JOPNJBM(Q J, O), G(Q J) = α + βYJ.
  6. Generalized Linear Models • (2) Model parameters with a link

    γSJ|"J= ≈ −. + .() = . Z J ∼ /PSNBM(µJ, σ), µJ = α + β YJ + β YJ + β YJ + β YJ YJ + β YJ YJ + β YJ YJ + β YJ YJ YJ. Z J ∼ /PSNBM(µJ, σ), µJ = α + βYJ. Z J ∼ #JOPNJBM(Q J, O), G(Q J) = α + βYJ. same units
  7. Generalized Linear Models µJ = α + β YJ +

    β YJ + β YJ + β YJ YJ + β YJ YJ + β YJ YJ + β YJ YJ YJ. Z J ∼ /PSNBM(µJ, σ), µJ = α + βYJ. Z J ∼ #JOPNJBM(Q J, O), G(Q J) = α + βYJ. same units ZJ ∼ #JOPNJBM(OJ, QJ) QJ ? α + βYJ -3 -2 -1 0 1 2 3 -0.5 0.0 0.5 1.0 1.5 x a+b*x
  8. Generalized Linear Models µJ = α + β YJ +

    β YJ + β YJ + β YJ YJ + β YJ YJ + β YJ YJ + β YJ YJ YJ. Z J ∼ /PSNBM(µJ, σ), µJ = α + βYJ. Z J ∼ #JOPNJBM(Q J, O), G(Q J) = α + βYJ. same units count ZJ ∼ #JOPNJBM(OJ, QJ) QJ ? α + βYJ -3 -2 -1 0 1 2 3 -0.5 0.0 0.5 1.0 1.5 x a+b*x
  9. Generalized Linear Models µJ = α + β YJ +

    β YJ + β YJ + β YJ YJ + β YJ YJ + β YJ YJ + β YJ YJ YJ. Z J ∼ /PSNBM(µJ, σ), µJ = α + βYJ. Z J ∼ #JOPNJBM(Q J, O), G(Q J) = α + βYJ. same units count probability ZJ ∼ #JOPNJBM(OJ, QJ) QJ ? α + βYJ -3 -2 -1 0 1 2 3 -0.5 0.0 0.5 1.0 1.5 x a+b*x
  10. Generalized Linear Models µJ = α + β YJ +

    β YJ + β YJ + β YJ YJ + β YJ YJ + β YJ YJ + β YJ YJ YJ. Z J ∼ /PSNBM(µJ, σ), µJ = α + βYJ. Z J ∼ #JOPNJBM(Q J, O), G(Q J) = α + βYJ. same units count ZJ ∼ #JOPNJBM(OJ, QJ) G(QJ) = α + βYJ -3 -2 -1 0 1 2 3 -0.5 0.0 0.5 1.0 1.5 x f^-1(a+b*x)
  11. Generalized Linear Models µJ = α + β YJ +

    β YJ + β YJ + β YJ YJ + β YJ YJ + β YJ YJ + β YJ YJ YJ. Z J ∼ /PSNBM(µJ, σ), µJ = α + βYJ. Z J ∼ #JOPNJBM(Q J, O), G(Q J) = α + βYJ. same units count link function ZJ ∼ #JOPNJBM(OJ, QJ) G(QJ) = α + βYJ -3 -2 -1 0 1 2 3 -0.5 0.0 0.5 1.0 1.5 x f^-1(a+b*x)
  12. Generalized Linear Models • (3) Compute posterior • Search is

    harder • Interpretation is harder • Links matter • Quadratic approximation often works, but not always • Safest to rely on MCMC
  13. • There are floor and ceiling effects floor ceiling -3

    -2 -1 0 1 2 3 0.00 0.50 1.00 temperature prob survival Everything interacts
  14. • Linear regression: • Logistic regression: Everything interacts FST JOUFSBDUJOH

    XJUI UIFNTFMWFT 8F DBO ĕOE TPNF GVSUIFS DMBSJUZ PO U WFSZ QSFEJDUPS WBSJBCMF UP JOUFSBDU XJUI JUTFMG CZ NBUIFNBUJDBMMZ DPNQVUJ PVUDPNF GPS B HJWFO DIBOHF JO UIF WBMVF PG UIF QSFEJDUPS 'JSTU SFDBMM UIBU UIF NFBO JT NPEFMFE MJLF µ = α + βY µ XJUI SFTQFDU UP Y JT KVTU ∂µ/∂Y = β "OE UIBUT DPOTUBOU *U EPFTOU NBUU X DPOTJEFS UIF SBUF PG DIBOHF JO B CJOPNJBM QSPCBCJMJUZ Q XJUI SFTQFDU UP Q = FYQ(α + βY)  + FYQ(α + βY) WBUJWF XJUI SFTQFDU UP Y ZJFMET ∂Q ∂Y = β   + DPTI(α + βY) OLJOH 1BSBNFUFST JOUFSBDUJOH XJUI UIFNTFMWFT 8F DBO ĕOE TPNF GVSUIFS D BU (-.T GPSDF FWFSZ QSFEJDUPS WBSJBCMF UP JOUFSBDU XJUI JUTFMG CZ NBUIFNBUJDBM PG DIBOHF JO UIF PVUDPNF GPS B HJWFO DIBOHF JO UIF WBMVF PG UIF QSFEJDUPS 'JSTU (BVTTJBO NPEFM UIF NFBO JT NPEFMFE MJLF µ = α + βY UF PG DIBOHF JO µ XJUI SFTQFDU UP Y JT KVTU ∂µ/∂Y = β "OE UIBUT DPOTUBOU *U E VF Y IBT #VU OPX DPOTJEFS UIF SBUF PG DIBOHF JO B CJOPNJBM QSPCBCJMJUZ Q XJUI S Y Q = FYQ(α + βY)  + FYQ(α + βY) X UBLJOH UIF EFSJWBUJWF XJUI SFTQFDU UP Y ZJFMET ∂Q ∂Y = β   + DPTI(α + βY) QQFBST JO UIJT BOTXFS UIF JNQBDU PG B DIBOHF JO Y EFQFOET VQPO Y ćBUT BO JOU BOE UIF POF UIBU BUUBJOT TUBUJTUJDBM TJHOJĕDBODF JT SFQPSUFE *O TFOTJUJWJUZ OBMZTFT BSF USJFE BOE BMM PG UIFN BSF EFTDSJCFE JOUFSBDUJOH XJUI UIFNTFMWFT 8F DBO ĕOE TPNF GVSUIFS DMBSJUZ PO UIF SZ QSFEJDUPS WBSJBCMF UP JOUFSBDU XJUI JUTFMG CZ NBUIFNBUJDBMMZ DPNQVUJOH UDPNF GPS B HJWFO DIBOHF JO UIF WBMVF PG UIF QSFEJDUPS 'JSTU SFDBMM UIBU JO F NFBO JT NPEFMFE MJLF µ = α + βY XJUI SFTQFDU UP Y JT KVTU ∂µ/∂Y = β "OE UIBUT DPOTUBOU *U EPFTOU NBUUFS DPOTJEFS UIF SBUF PG DIBOHF JO B CJOPNJBM QSPCBCJMJUZ Q XJUI SFTQFDU UP B Q = FYQ(α + βY)  + FYQ(α + βY) JWF XJUI SFTQFDU UP Y ZJFMET ∂Q ∂Y = β   + DPTI(α + βY) 0WFSUIJOLJOH 1BSBNFUFST JOUFSBDUJOH XJUI UIFNTFMWFT 8F DBO ĕOE TPN DMBJN UIBU (-.T GPSDF FWFSZ QSFEJDUPS WBSJBCMF UP JOUFSBDU XJUI JUTFMG CZ N UIF SBUF PG DIBOHF JO UIF PVUDPNF GPS B HJWFO DIBOHF JO UIF WBMVF PG UIF QSFE B DMBTTJD (BVTTJBO NPEFM UIF NFBO JT NPEFMFE MJLF µ = α + βY 4P UIF SBUF PG DIBOHF JO µ XJUI SFTQFDU UP Y JT KVTU ∂µ/∂Y = β "OE UIBUT D XIBU WBMVF Y IBT #VU OPX DPOTJEFS UIF SBUF PG DIBOHF JO B CJOPNJBM QSPCB QSFEJDUPS Y Q = FYQ(α + βY)  + FYQ(α + βY) "OE OPX UBLJOH UIF EFSJWBUJWF XJUI SFTQFDU UP Y ZJFMET ∂Q ∂Y = β   + DPTI(α + βY) 4JODF Y BQQFBST JO UIJT BOTXFS UIF JNQBDU PG B DIBOHF JO Y EFQFOET VQPO Y JUTFMG
  15. • Counts of a specific event out of n possibilities

    • Constant expected value • Maxent: Binomial Binomial distribution Z ∼ #JOPNJBM(O, Q) 0 2 4 6 8 10 0 500 1500 2500 Count Frequency lambda=0.5
  16. • Counts of a specific event out of n possibilities

    • Constant expected value • Maxent: Binomial Binomial distribution count “successes” Z ∼ #JOPNJBM(O, Q) 0 2 4 6 8 10 0 500 1500 2500 Count Frequency lambda=0.5
  17. • Counts of a specific event out of n possibilities

    • Constant expected value • Maxent: Binomial Binomial distribution count “successes” number of trials Z ∼ #JOPNJBM(O, Q) 0 2 4 6 8 10 0 500 1500 2500 Count Frequency lambda=0.5
  18. • Counts of a specific event out of n possibilities

    • Constant expected value • Maxent: Binomial Binomial distribution count “successes” number of trials probability of success Z ∼ #JOPNJBM(O, Q) 0 2 4 6 8 10 0 500 1500 2500 Count Frequency lambda=0.5
  19. Binomial distribution Z ∼ #JOPNJBM(O, Q) &(Z) = OQ WBS(Z)

    = OQ( − Q) Mean and variance not independent • Counts of a specific event out of n possibilities • Constant expected value • Maxent: Binomial 0 2 4 6 8 10 0 500 1500 2500 Count Frequency lambda=0.5
  20. Need a link • y and p on different scales

    • y: count • p: probability • Want to model p as function of predictor variables • Must bound it to [0,1] interval Z ∼ #JOPNJBM(O, Q)
  21. Logit link • Goal: map linear model to [0,1] 

    (&/&3"-*;&% -*/&"3 .0%&-4  -1.0 -0.5 0.0 0.5 1.0 -4 -2 0 2 4 x log-odds -1.0 -0.5 0.0 0.5 1.0 x 0.0 0.5 1.0 probability 'ĶĴłĿIJ ƑƎ ćF MPHJU MJOL USBOTGPSNT B MJOFBS NPEFM MFę JOUP B QSPCBCJMJUZ SJHIU  ćJT USBOTGPSNBUJPO DPNQSFTTFT UIF HFPNFUSZ GBS GSPN [FSP TVDI
  22. Logit link • Goal: map linear model to [0,1] 

    (&/&3"-*;&% -*/&"3 .0%&-4  -1.0 -0.5 0.0 0.5 1.0 -4 -2 0 2 4 x log-odds -1.0 -0.5 0.0 0.5 1.0 x 0.0 0.5 1.0 probability 'ĶĴłĿIJ ƑƎ ćF MPHJU MJOL USBOTGPSNT B MJOFBS NPEFM MFę JOUP B QSPCBCJMJUZ SJHIU  ćJT USBOTGPSNBUJPO DPNQSFTTFT UIF HFPNFUSZ GBS GSPN [FSP TVDI
  23. -1.0 -0.5 0.0 0.5 1.0 -4 -2 0 2 4

    x log-odds -1.0 -0.5 0.0 0.5 1.0 x 0.0 0.5 1.0 probability 'ĶĴłĿIJ ƑƎ ćF MPHJU MJOL USBOTGPSNT B MJOFBS NPEFM MFę JOUP B QSPCBCJMJUZ SJHIU  ćJT USBOTGPSNBUJPO DPNQSFTTFT UIF HFPNFUSZ GBS GSPN [FSP TVDI UIBU B VOJU DIBOHF PO UIF MJOFBS TDBMF MFę NFBOT MFTT BOE MFTT DIBOHF PO UIF QSPCBCJMJUZ TDBMF SJHIU  QSPCBCJMJUZ QJ EFQFOEJOH VQPO IPX GBS GSPN [FSP UIF MPHPEET BSF 'PS FYBNQMF JG 'ĶĴ łĿIJ ƑƎ XIFO Y =  UIF MJOFBS NPEFM IBT B WBMVF PG [FSP PO UIF MPHPEET TDBMF " IBMGVOJU JODSFBTF JO Y SFTVMUT JO BCPVU B  JODSFBTF JO QSPCBCJMJUZ #VU FBDI BEEJUJPO IBMGVOJU XJMM QSPEVDF MFTT BOE MFTT PG BO JODSFBTF JO QSPCBCJMJUZ VOUJM BOZ JODSFBTF JT WBOJTIJOHMZ TNBMM ZJ ∼ ;BQIPE(θJ, φ) G (θJ) = α + βYJ G JT B MJOL GVODUJPO VU XIBU GVODUJPO TIPVME G CF " MJOL GVODUJPOT KPC JT UP NBQ UIF MJOFBS TQBDF PG B N + βYJ POUP UIF OPOMJOFBS TQBDF PG B QBSBNFUFS MJLF θ 4P G JT DIPTFO XJUI UIBU H .PTU PG UIF UJNF GPS NPTU (-.T ZPV DBO VTF POF PG UXP FYDFFEJOHMZ DPNNPO MJOL PS B MPH MJOL -FUT JOUSPEVDF FBDI BOE ZPVMM XPSL XJUI CPUI JO MBUFS DIBQUF ćF ĹļĴĶŁ ĹĶĻĸ NBQT B QBSBNFUFS UIBU JT EFĕOFE BT B QSPCBCJMJUZ NBTT BOE UIF BJOFE UP MJF CFUXFFO [FSP BOE POF POUP B MJOFBS NPEFM UIBU DBO UBLF PO BOZ SFBM OL JT FYUSFNFMZ DPNNPO XIFO XPSLJOH XJUI CJOPNJBM (-.T *O UIF DPOUFY EFĕOJUJPO JU MPPLT MJLF UIJT ZJ ∼ #JOPNJBM(O, QJ) MPHJU(QJ) = α + βYJ IF MPHJU GVODUJPO JUTFMG JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ
  24. -1.0 -0.5 0.0 0.5 1.0 -4 -2 0 2 4

    x log-odds -1.0 -0.5 0.0 0.5 1.0 x 0.0 0.5 1.0 probability 'ĶĴłĿIJ ƑƎ ćF MPHJU MJOL USBOTGPSNT B MJOFBS NPEFM MFę JOUP B QSPCBCJMJUZ SJHIU  ćJT USBOTGPSNBUJPO DPNQSFTTFT UIF HFPNFUSZ GBS GSPN [FSP TVDI UIBU B VOJU DIBOHF PO UIF MJOFBS TDBMF MFę NFBOT MFTT BOE MFTT DIBOHF PO UIF QSPCBCJMJUZ TDBMF SJHIU  QSPCBCJMJUZ QJ EFQFOEJOH VQPO IPX GBS GSPN [FSP UIF MPHPEET BSF 'PS FYBNQMF JG 'ĶĴ łĿIJ ƑƎ XIFO Y =  UIF MJOFBS NPEFM IBT B WBMVF PG [FSP PO UIF MPHPEET TDBMF " IBMGVOJU JODSFBTF JO Y SFTVMUT JO BCPVU B  JODSFBTF JO QSPCBCJMJUZ #VU FBDI BEEJUJPO IBMGVOJU XJMM QSPEVDF MFTT BOE MFTT PG BO JODSFBTF JO QSPCBCJMJUZ VOUJM BOZ JODSFBTF JT WBOJTIJOHMZ TNBMM ZJ ∼ ;BQIPE(θJ, φ) G (θJ) = α + βYJ G JT B MJOL GVODUJPO VU XIBU GVODUJPO TIPVME G CF " MJOL GVODUJPOT KPC JT UP NBQ UIF MJOFBS TQBDF PG B N + βYJ POUP UIF OPOMJOFBS TQBDF PG B QBSBNFUFS MJLF θ 4P G JT DIPTFO XJUI UIBU H .PTU PG UIF UJNF GPS NPTU (-.T ZPV DBO VTF POF PG UXP FYDFFEJOHMZ DPNNPO MJOL PS B MPH MJOL -FUT JOUSPEVDF FBDI BOE ZPVMM XPSL XJUI CPUI JO MBUFS DIBQUF ćF ĹļĴĶŁ ĹĶĻĸ NBQT B QBSBNFUFS UIBU JT EFĕOFE BT B QSPCBCJMJUZ NBTT BOE UIF BJOFE UP MJF CFUXFFO [FSP BOE POF POUP B MJOFBS NPEFM UIBU DBO UBLF PO BOZ SFBM OL JT FYUSFNFMZ DPNNPO XIFO XPSLJOH XJUI CJOPNJBM (-.T *O UIF DPOUFY EFĕOJUJPO JU MPPLT MJLF UIJT ZJ ∼ #JOPNJBM(O, QJ) MPHJU(QJ) = α + βYJ IF MPHJU GVODUJPO JUTFMG JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ
  25. -1.0 -0.5 0.0 0.5 1.0 -4 -2 0 2 4

    x log-odds -1.0 -0.5 0.0 0.5 1.0 x 0.0 0.5 1.0 probability 'ĶĴłĿIJ ƑƎ ćF MPHJU MJOL USBOTGPSNT B MJOFBS NPEFM MFę JOUP B QSPCBCJMJUZ SJHIU  ćJT USBOTGPSNBUJPO DPNQSFTTFT UIF HFPNFUSZ GBS GSPN [FSP TVDI UIBU B VOJU DIBOHF PO UIF MJOFBS TDBMF MFę NFBOT MFTT BOE MFTT DIBOHF PO UIF QSPCBCJMJUZ TDBMF SJHIU  QSPCBCJMJUZ QJ EFQFOEJOH VQPO IPX GBS GSPN [FSP UIF MPHPEET BSF 'PS FYBNQMF JG 'ĶĴ łĿIJ ƑƎ XIFO Y =  UIF MJOFBS NPEFM IBT B WBMVF PG [FSP PO UIF MPHPEET TDBMF " IBMGVOJU JODSFBTF JO Y SFTVMUT JO BCPVU B  JODSFBTF JO QSPCBCJMJUZ #VU FBDI BEEJUJPO IBMGVOJU XJMM QSPEVDF MFTT BOE MFTT PG BO JODSFBTF JO QSPCBCJMJUZ VOUJM BOZ JODSFBTF JT WBOJTIJOHMZ TNBMM ZJ ∼ ;BQIPE(θJ, φ) G (θJ) = α + βYJ G JT B MJOL GVODUJPO VU XIBU GVODUJPO TIPVME G CF " MJOL GVODUJPOT KPC JT UP NBQ UIF MJOFBS TQBDF PG B N + βYJ POUP UIF OPOMJOFBS TQBDF PG B QBSBNFUFS MJLF θ 4P G JT DIPTFO XJUI UIBU H .PTU PG UIF UJNF GPS NPTU (-.T ZPV DBO VTF POF PG UXP FYDFFEJOHMZ DPNNPO MJOL PS B MPH MJOL -FUT JOUSPEVDF FBDI BOE ZPVMM XPSL XJUI CPUI JO MBUFS DIBQUF ćF ĹļĴĶŁ ĹĶĻĸ NBQT B QBSBNFUFS UIBU JT EFĕOFE BT B QSPCBCJMJUZ NBTT BOE UIF BJOFE UP MJF CFUXFFO [FSP BOE POF POUP B MJOFBS NPEFM UIBU DBO UBLF PO BOZ SFBM OL JT FYUSFNFMZ DPNNPO XIFO XPSLJOH XJUI CJOPNJBM (-.T *O UIF DPOUFY EFĕOJUJPO JU MPPLT MJLF UIJT ZJ ∼ #JOPNJBM(O, QJ) MPHJU(QJ) = α + βYJ IF MPHJU GVODUJPO JUTFMG JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ
  26. NNPO XIFO XPSLJOH XJUI CJOPNJBM (-.T *O UIF DPOUFYU PG

    B MJLF UIJT ZJ ∼ #JOPNJBM(O, QJ) MPHJU(QJ) = α + βYJ FMG JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ F KVTU UIF QSPCBCJMJUZ JU IBQQFOT EJWJEFE CZ UIF QSPCBCJMJUZ JU EPFT IBU JT CFJOH TUBUFE IFSF JT MPH QJ  − QJ = α + βYJ UJPO PG QJ JNQMJFE IFSF KVTU EP B MJUUMF BMHFCSB BOE TPMWF UIF BCPWF QJ = FYQ(α + βYJ)  + FYQ(α + βYJ) BMMZ DBMMFE UIF ĹļĴĶŀŁĶİ *O UIJT DPOUFYU JU JT BMTP DPNNPOMZ DBMMFE -1.0 -0.5 0.0 0.5 1.0 -4 -2 0 2 4 x log-odds -1 'ĶĴłĿIJ ƑƎ ćF MPHJU MJOL USBOTGPSNT B MJ SJHIU  ćJT USBOTGPSNBUJPO DPNQSFTTFT UIBU B VOJU DIBOHF PO UIF MJOFBS TDBMF MFę QSPCBCJMJUZ TDBMF SJHIU  QSPCBCJMJUZ QJ EFQFOEJOH VQPO IPX GBS GSPN [F łĿIJ ƑƎ XIFO Y =  UIF MJOFBS NPEFM IBT B WBMVF JODSFBTF JO Y SFTVMUT JO BCPVU B  JODSFBTF JO QS QSPEVDF MFTT BOE MFTT PG BO JODSFBTF JO QSPCBCJMJU "OE JG ZPV UIJOL BCPVU JU B HPPE NPEFM PG QSPCB FWFOU JT BMNPTU HVBSBOUFFE UP IBQQFO JUT QSPCBCJ IPX JNQPSUBOU UIF QSFEJDUPS NBZ CF  (&/&3"-*;&% -*/&"3 .0%&-4 -1.0 -0.5 0.0 0.5 1.0 -4 -2 0 2 4 x log-odds -1.0 -0.5 0.0 0.5 1.0 x 0.0 0.5 1.0 probability
  27. NNPO XIFO XPSLJOH XJUI CJOPNJBM (-.T *O UIF DPOUFYU PG

    B MJLF UIJT ZJ ∼ #JOPNJBM(O, QJ) MPHJU(QJ) = α + βYJ FMG JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ F KVTU UIF QSPCBCJMJUZ JU IBQQFOT EJWJEFE CZ UIF QSPCBCJMJUZ JU EPFT IBU JT CFJOH TUBUFE IFSF JT MPH QJ  − QJ = α + βYJ UJPO PG QJ JNQMJFE IFSF KVTU EP B MJUUMF BMHFCSB BOE TPMWF UIF BCPWF QJ = FYQ(α + βYJ)  + FYQ(α + βYJ) BMMZ DBMMFE UIF ĹļĴĶŀŁĶİ *O UIJT DPOUFYU JU JT BMTP DPNNPOMZ DBMMFE NPO XIFO XPSLJOH XJUI CJOPNJBM (-.T *O UIF DPOUFYU PG B F UIJT ZJ ∼ #JOPNJBM(O, QJ) MPHJU(QJ) = α + βYJ JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ VTU UIF QSPCBCJMJUZ JU IBQQFOT EJWJEFE CZ UIF QSPCBCJMJUZ JU EPFT JT CFJOH TUBUFE IFSF JT MPH QJ  − QJ = α + βYJ O PG QJ JNQMJFE IFSF KVTU EP B MJUUMF BMHFCSB BOE TPMWF UIF BCPWF QJ = FYQ(α + βYJ)  + FYQ(α + βYJ) DBMMFE UIF ĹļĴĶŀŁĶİ *O UIJT DPOUFYU JU JT BMTP DPNNPOMZ DBMMFE UJPO JUTFMG JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ WFOU BSF KVTU UIF QSPCBCJMJUZ JU IBQQFOT EJWJEFE CZ UIF QSPCBCJMJUZ JU EPFT BMMZ BMM UIBU JT CFJOH TUBUFE IFSF JT MPH QJ  − QJ = α + βYJ F EFĕOJUJPO PG QJ JNQMJFE IFSF KVTU EP B MJUUMF BMHFCSB BOE TPMWF UIF BCPWF QJ = FYQ(α + βYJ)  + FYQ(α + βYJ) O JT VTVBMMZ DBMMFE UIF ĹļĴĶŀŁĶİ *O UIJT DPOUFYU JU JT BMTP DPNNPOMZ DBMMFE ĶŁ CFDBVTF JU JOWFSUT UIF MPHJU USBOTGPSN T NFBOT JT UIBU XIFO ZPV VTF B MPHJU MJOL GPS B QBSBNFUFS ZPV BSF EFĕOJOH MVF UP CF UIF MPHJTUJD USBOTGPSN PG UIF MJOFBS NPEFM 'ĶĴłĿIJ ƑƎ JMMVTUSBUFT O UIBU UBLFT QMBDF XIFO VTJOH B MPHJU MJOL 0O UIF MFę UIF HFPNFUSZ PG UIF PXO XJUI IPSJ[POUBM MJOFT JOEJDBUJOH VOJU DIBOHFT JO UIF WBMVF PG UIF MJO -1.0 -0.5 0.0 0.5 1.0 -4 -2 0 2 4 x log-odds -1 'ĶĴłĿIJ ƑƎ ćF MPHJU MJOL USBOTGPSNT B MJ SJHIU  ćJT USBOTGPSNBUJPO DPNQSFTTFT UIBU B VOJU DIBOHF PO UIF MJOFBS TDBMF MFę QSPCBCJMJUZ TDBMF SJHIU  QSPCBCJMJUZ QJ EFQFOEJOH VQPO IPX GBS GSPN [F łĿIJ ƑƎ XIFO Y =  UIF MJOFBS NPEFM IBT B WBMVF JODSFBTF JO Y SFTVMUT JO BCPVU B  JODSFBTF JO QS QSPEVDF MFTT BOE MFTT PG BO JODSFBTF JO QSPCBCJMJU "OE JG ZPV UIJOL BCPVU JU B HPPE NPEFM PG QSPCB FWFOU JT BMNPTU HVBSBOUFFE UP IBQQFO JUT QSPCBCJ IPX JNQPSUBOU UIF QSFEJDUPS NBZ CF  (&/&3"-*;&% -*/&"3 .0%&-4 -1.0 -0.5 0.0 0.5 1.0 -4 -2 0 2 4 x log-odds -1.0 -0.5 0.0 0.5 1.0 x 0.0 0.5 1.0 probability
  28. NNPO XIFO XPSLJOH XJUI CJOPNJBM (-.T *O UIF DPOUFYU PG

    B MJLF UIJT ZJ ∼ #JOPNJBM(O, QJ) MPHJU(QJ) = α + βYJ FMG JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ F KVTU UIF QSPCBCJMJUZ JU IBQQFOT EJWJEFE CZ UIF QSPCBCJMJUZ JU EPFT IBU JT CFJOH TUBUFE IFSF JT MPH QJ  − QJ = α + βYJ UJPO PG QJ JNQMJFE IFSF KVTU EP B MJUUMF BMHFCSB BOE TPMWF UIF BCPWF QJ = FYQ(α + βYJ)  + FYQ(α + βYJ) BMMZ DBMMFE UIF ĹļĴĶŀŁĶİ *O UIJT DPOUFYU JU JT BMTP DPNNPOMZ DBMMFE NPO XIFO XPSLJOH XJUI CJOPNJBM (-.T *O UIF DPOUFYU PG B F UIJT ZJ ∼ #JOPNJBM(O, QJ) MPHJU(QJ) = α + βYJ JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ VTU UIF QSPCBCJMJUZ JU IBQQFOT EJWJEFE CZ UIF QSPCBCJMJUZ JU EPFT JT CFJOH TUBUFE IFSF JT MPH QJ  − QJ = α + βYJ O PG QJ JNQMJFE IFSF KVTU EP B MJUUMF BMHFCSB BOE TPMWF UIF BCPWF QJ = FYQ(α + βYJ)  + FYQ(α + βYJ) DBMMFE UIF ĹļĴĶŀŁĶİ *O UIJT DPOUFYU JU JT BMTP DPNNPOMZ DBMMFE UJPO JUTFMG JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ WFOU BSF KVTU UIF QSPCBCJMJUZ JU IBQQFOT EJWJEFE CZ UIF QSPCBCJMJUZ JU EPFT BMMZ BMM UIBU JT CFJOH TUBUFE IFSF JT MPH QJ  − QJ = α + βYJ F EFĕOJUJPO PG QJ JNQMJFE IFSF KVTU EP B MJUUMF BMHFCSB BOE TPMWF UIF BCPWF QJ = FYQ(α + βYJ)  + FYQ(α + βYJ) O JT VTVBMMZ DBMMFE UIF ĹļĴĶŀŁĶİ *O UIJT DPOUFYU JU JT BMTP DPNNPOMZ DBMMFE ĶŁ CFDBVTF JU JOWFSUT UIF MPHJU USBOTGPSN T NFBOT JT UIBU XIFO ZPV VTF B MPHJU MJOL GPS B QBSBNFUFS ZPV BSF EFĕOJOH MVF UP CF UIF MPHJTUJD USBOTGPSN PG UIF MJOFBS NPEFM 'ĶĴłĿIJ ƑƎ JMMVTUSBUFT O UIBU UBLFT QMBDF XIFO VTJOH B MPHJU MJOL 0O UIF MFę UIF HFPNFUSZ PG UIF PXO XJUI IPSJ[POUBM MJOFT JOEJDBUJOH VOJU DIBOHFT JO UIF WBMVF PG UIF MJO Solve for pi : MPHJU(QJ) = α + βYJ MG JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ KVTU UIF QSPCBCJMJUZ JU IBQQFOT EJWJEFE CZ UIF QSPCBCJMJUZ JU EPFT BU JT CFJOH TUBUFE IFSF JT MPH QJ  − QJ = α + βYJ JPO PG QJ JNQMJFE IFSF KVTU EP B MJUUMF BMHFCSB BOE TPMWF UIF BCPWF QJ = FYQ(α + βYJ)  + FYQ(α + βYJ) MZ DBMMFE UIF ĹļĴĶŀŁĶİ *O UIJT DPOUFYU JU JT BMTP DPNNPOMZ DBMMFE TF JU JOWFSUT UIF MPHJU USBOTGPSN JT UIBU XIFO ZPV VTF B MPHJU MJOL GPS B QBSBNFUFS ZPV BSF EFĕOJOH UIF MPHJTUJD USBOTGPSN PG UIF MJOFBS NPEFM 'ĶĴłĿIJ ƑƎ JMMVTUSBUFT LFT QMBDF XIFO VTJOH B MPHJU MJOL 0O UIF MFę UIF HFPNFUSZ PG UIF -1.0 -0.5 0.0 0.5 1.0 -4 -2 0 2 4 x log-odds -1 'ĶĴłĿIJ ƑƎ ćF MPHJU MJOL USBOTGPSNT B MJ SJHIU  ćJT USBOTGPSNBUJPO DPNQSFTTFT UIBU B VOJU DIBOHF PO UIF MJOFBS TDBMF MFę QSPCBCJMJUZ TDBMF SJHIU  QSPCBCJMJUZ QJ EFQFOEJOH VQPO IPX GBS GSPN [F łĿIJ ƑƎ XIFO Y =  UIF MJOFBS NPEFM IBT B WBMVF JODSFBTF JO Y SFTVMUT JO BCPVU B  JODSFBTF JO QS QSPEVDF MFTT BOE MFTT PG BO JODSFBTF JO QSPCBCJMJU "OE JG ZPV UIJOL BCPVU JU B HPPE NPEFM PG QSPCB FWFOU JT BMNPTU HVBSBOUFFE UP IBQQFO JUT QSPCBCJ IPX JNQPSUBOU UIF QSFEJDUPS NBZ CF  (&/&3"-*;&% -*/&"3 .0%&-4 -1.0 -0.5 0.0 0.5 1.0 -4 -2 0 2 4 x log-odds -1.0 -0.5 0.0 0.5 1.0 x 0.0 0.5 1.0 probability inverse-link is logistic
  29. 0.00 0.25 0.50 0.75 1.00 -4 -2 0 2 4

    probability log-odds 0.00 0 0 20 40 60 80 100 odds 'JHVSF  -PHPEET WFSTVT PSEJOBSZ PEE log-odds = 1 log-odds = 3 p = 0.73 p = 0.95
  30. Logit link • Where does this thing come from? •

    Several good answers: • “Natural” link inside probability formula • log-odds is fundamental parameter • See Overthinking box, pages 279–280 • Other links sometimes justified • Probit (common in economics) • Complementary-log-log (cloglog, common where?) ĹļĴĶŁ ĹĶĻĸ NBQT B QBSBNFUFS UIBU JT EFĕOFE BT B QSPCBCJMJUZ NBTT BOE UIFSFG OFE UP MJF CFUXFFO [FSP BOE POF POUP B MJOFBS NPEFM UIBU DBO UBLF PO BOZ SFBM WBM JT FYUSFNFMZ DPNNPO XIFO XPSLJOH XJUI CJOPNJBM (-.T *O UIF DPOUFYU P FĕOJUJPO JU MPPLT MJLF UIJT ZJ ∼ #JOPNJBM(O, QJ) MPHJU(QJ) = α + βYJ MPHJU GVODUJPO JUTFMG JT EFĕOFE BT UIF MPHPEET MPHJU(QJ) = MPH QJ  − QJ Tw PG BO FWFOU BSF KVTU UIF QSPCBCJMJUZ JU IBQQFOT EJWJEFE CZ UIF QSPCBCJMJUZ JU EP FO 4P SFBMMZ BMM UIBU JT CFJOH TUBUFE IFSF JT MPH QJ  − QJ = α + βYJ VSF PVU UIF EFĕOJUJPO PG QJ JNQMJFE IFSF KVTU EP B MJUUMF BMHFCSB BOE TPMWF UIF BCP GPS QJ  QJ = FYQ(α + βYJ)  + FYQ(α + βYJ)
  31. Example: UCB admissions • Numbers accepted/rejected to 6 PhD programs

    at UC Berkeley (largest depts in 1973) • Evidence of gender discrimination? Dean was afraid of lawsuit. • Call in the statisticians!   $06/5*/( "/% $-"44*'*$"5*0/ 3 DPEF  '$--4ǿ- /#$)&$)"Ȁ /ǿ($/Ȁ  ʚǶ ($/ ćJT EBUB UBCMF POMZ IBT  SPXT TP MFUT MPPL BU UIF FOUJSF UIJOH  +/ ++'$)/ǡ" ) - ($/ - % / ++'$/$*). ǎ  (' ǒǎǏ ǐǎǐ ǕǏǒ Ǐ  ! (' Ǖǖ ǎǖ ǎǍǕ ǐ  (' ǐǒǐ ǏǍǔ ǒǓǍ Ǒ  ! (' ǎǔ Ǖ Ǐǒ ǒ  (' ǎǏǍ ǏǍǒ ǐǏǒ Ǔ  ! (' ǏǍǏ ǐǖǎ ǒǖǐ ǔ  (' ǎǐǕ Ǐǔǖ Ǒǎǔ Ǖ  ! (' ǎǐǎ ǏǑǑ ǐǔǒ ǖ  (' ǒǐ ǎǐǕ ǎǖǎ ǎǍ  ! (' ǖǑ Ǐǖǖ ǐǖǐ ǎǎ  (' ǏǏ ǐǒǎ ǐǔǐ ǎǏ  ! (' ǏǑ ǐǎǔ ǐǑǎ ćFTF BSF HSBEVBUF TDIPPM BQQMJDBUJPOT UP  EJČFSFOU BDBEFNJD EFQBSUNFOUT BU 6$ #FSLF MFZ ćF ($/ DPMVNO JOEJDBUFT UIF OVNCFS PČFSFE BENJTTJPO ćF - % / DPMVNO
  32. Example: UCB admissions dept applicant.gender admit reject applications 1 A

    male 512 313 825 2 A female 89 19 108 3 B male 353 207 560 4 B female 17 8 25 5 C male 120 205 325 6 C female 202 391 593 7 D male 138 279 417 8 D female 131 244 375 9 E male 53 138 191 10 E female 94 299 393 11 F male 22 351 373 12 F female 24 317 341   $06/5*/( "/% $-"44*'*$"5*0/ 3 DPEF  '$--4ǿ- /#$)&$)"Ȁ /ǿ($/Ȁ  ʚǶ ($/ ćJT EBUB UBCMF POMZ IBT  SPXT TP MFUT MPPL BU UIF FOUJSF UIJOH  +/ ++'$)/ǡ" ) - ($/ - % / ++'$/$*). ǎ  (' ǒǎǏ ǐǎǐ ǕǏǒ Ǐ  ! (' Ǖǖ ǎǖ ǎǍǕ ǐ  (' ǐǒǐ ǏǍǔ ǒǓǍ Ǒ  ! (' ǎǔ Ǖ Ǐǒ ǒ  (' ǎǏǍ Ǐ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F‰DPVOUJOH UIF SPXT JO UIF EBUB UBCMF JT OP MPOHFS B TFOTJCM 8F DPVME TQMJU UIFTF EBUB BQBSU JOUP  #FSOPVMMJ USJBMT MJLF JO UI ćFO UIFSF XPVME CF  SPXT JO UIF EBUB 0VS KPC JT UP FWBMVBUF XIFUIFS UIFTF EBUB DPOUBJO FWJEFODF P 4P XF XJMM NPEFM UIF BENJTTJPO EFDJTJPOT GPDVTJOH PO BQQMJDBO BCMF 4P XF XBOU UP ĕU BU MFBTU UXP NPEFMT  " CJOPNJBM SFHSFTTJPO UIBU NPEFMT ($/ BT B GVODUJP ćJT XJMM FTUJNBUF UIF BTTPDJBUJPO CFUXFFO HFOEFS BOE  " CJOPNJBM SFHSFTTJPO UIBU NPEFMT ($/ BT B DPOTUBO BMMPX VT UP HFU B TFOTF PG BOZ PWFSĕUUJOH DPNNJUUFE CZ ćJT JT XIBU UIF ĕSTU NPEFM MPPLT MJLF JO NBUIFNBUJDBM GPSN OBENJU,J ∼ #JOPNJBM(OJ, QJ) MPHJU(QJ) = α + βN NJ α ∼ /PSNBM(, ) βN ∼ /PSNBM(, ) ćF WBSJBCMF OJ JOEJDBUFT ++'$/$*).ȁ$Ȃ UIF OVNCFS PG BQQ EJDUPS NJ JT B EVNNZ UIBU JOEJDBUFT iNBMFw 8FMM DPOTUSVDU JU KVT MJLF UIJT dept applicant.gender admit reject applications 1 A male 512 313 825 2 A female 89 19 108 3 B male 353 207 560 4 B female 17 8 25 5 C male 120 205 325 6 C female 202 391 593 7 D male 138 279 417 8 D female 131 244 375 9 E male 53 138 191 10 E female 94 299 393 11 F male 22 351 373 12 F female 24 317 341
  34.  #*/0.*"- 3&(3&44*0/  3 DPEF  !ɢ*)" ʆǦ &#")0"ǯ

    !ɢ--)& +1Ǒ$"+!"/ʅʅǛ*)"Ǜ ǒ ƾ ǒ ƽ ǰ *ƾƽǑǃ ʆǦ *-ǯ )&01ǯ !*&1 ʍ !&+,*ǯ --)& 1&,+0 ǒ - ǰ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S FODF JO BENJTTJPO PEET BT FYQ(.) ≈ . ćJT NFBOT UIBU B NBMF BQQMJDBOUT PEET XFSF  PG B GFNBMF BQQMJDBOUT 0O UIF BCTPMVUF TDBMF XIJDI JT XIBU NBUUFST UIF EJČFSFODF JO QSPCBCJMJUZ PG BENJTTJPO JT 3 DPEF  +*./ ʚǶ 3/-/ǡ.(+' .ǿ (ǎǍǡǓ Ȁ +ǡ($/ǡ(' ʚǶ '*"$./$ǿ +*./ɶ ʔ +*./ɶ( Ȁ +ǡ($/ǡ! (' ʚǶ '*"$./$ǿ +*./ɶ Ȁ m10.7 m10.6 5960 5980 6000 6020 6040 6060 6080 deviance WAIC
  36. Proportional change in odds • How to interpret these coefficients?

    • exp(estimate) gives proportional change in odds • Is a relative effect size exp(0.61) ≈ 1.84 => male has 184% odds of female " RVJDL 8"*$ DPNQBSJTPO WFSJĕFT UIBU UIF *)" QSFEJDUPS WBSJBCMF JNQSPWFT FYQFDUFE PVU PGTBNQMF EFWJBODF CZ B WFSZ MBSHF BNPVOU 3 DPEF  ,*-/"ǯ *ƾƽǑǃ ǒ *ƾƽǑDŽ ǰ   -  !  4"&$%1  ! *ƾƽǑǃ ǂdžǂǁǑdž ƿ ƽǑƽ ƾ ǀǁǑdžDž  *ƾƽǑDŽ ǃƽǁǃǑǀ ƾ džƾǑǂ ƽ ƿdžǑdžǀ ƾdžǑƾǀ ćJT DPNQBSJTPO TVHHFTUT UIBU HFOEFS NBUUFST B MPU 5P TFF IPX JU NBUUFST XF IBWF UP MPPL BU FTUJNBUFT GPS N 3 DPEF  -/" &0ǯ*ƾƽǑǃǰ "+ 1!"3 ǂǑǂɵ džǁǑǂɵ  ǦƽǑDžǀ ƽǑƽǂ ǦƽǑdžƾ ǦƽǑDŽǂ * ƽǑǃƾ ƽǑƽǃ ƽǑǂƾ ƽǑDŽƾ 4FFNT MJLF CFJOH NBMF JT BO BEWBOUBHF JO UIJT DPOUFYU :PV DBO DPNQVUF UIF SFMBUJWF EJČFS FODF JO BENJTTJPO PEET BT FYQ(.) ≈ . ćJT NFBOT UIBU B NBMF BQQMJDBOUT PEET XFSF  PG B GFNBMF BQQMJDBOUT 0O UIF BCTPMVUF TDBMF XIJDI JT XIBU NBUUFST UIF EJČFSFODF JO QSPCBCJMJUZ PG BENJTTJPO JT 3 DPEF  -,01 ʆǦ "51/ 1Ǒ0*-)"0ǯ *ƾƽǑǃ ǰ -Ǒ!*&1Ǒ*)" ʆǦ ),$&01& ǯ -,01ɢ ʀ -,01ɢ* ǰ -Ǒ!*&1Ǒ#"*)" ʆǦ ),$&01& ǯ -,01ɢ ǰ
  37. Relative and absolute effects • Parameters on relative effect scale

    • Predictions on absolute effect scale • Using relative effects may exaggerate importance of predictor • Good for scaring people, getting published • Not so good for public health, scientific progress • But needed for causal inference relative shark absolute deer
  38. None
  39. Risk communication • Many people mistake relative risk for absolute

    risk • Example: • 1/1000 women develop blood clots • 3/1000 women on birth control develop blood clots • => 200% increase in blood clots! • Change in probability is only 0.002 • Pregnancy much more dangerous than blood clots
  40. Compute probabilities • Absolute effect size is on outcome scale:

    logistic( -0.83 ) logistic( -0.83 + 0.61 ) [1] 0.3036451 [1] 0.4452208 " RVJDL 8"*$ DPNQBSJTPO WFSJĕFT UIBU UIF *)" QSFEJDUPS WBSJBCMF JNQSPWFT FYQFDUFE PVU PGTBNQMF EFWJBODF CZ B WFSZ MBSHF BNPVOU 3 DPEF  ,*-/"ǯ *ƾƽǑǃ ǒ *ƾƽǑDŽ ǰ   -  !  4"&$%1  ! *ƾƽǑǃ ǂdžǂǁǑdž ƿ ƽǑƽ ƾ ǀǁǑdžDž  *ƾƽǑDŽ ǃƽǁǃǑǀ ƾ džƾǑǂ ƽ ƿdžǑdžǀ ƾdžǑƾǀ ćJT DPNQBSJTPO TVHHFTUT UIBU HFOEFS NBUUFST B MPU 5P TFF IPX JU NBUUFST XF IBWF UP MPPL BU FTUJNBUFT GPS N 3 DPEF  -/" &0ǯ*ƾƽǑǃǰ "+ 1!"3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JOPNJBM SFHSFTTJPO UIBU NPEFMT ($/ BT B GVODUJPO PG ćJT XJMM FTUJNBUF UIF BTTPDJBUJPO CFUXFFO HFOEFS BOE QSPC  " CJOPNJBM SFHSFTTJPO UIBU NPEFMT ($/ BT B DPOTUBOU JHO BMMPX VT UP HFU B TFOTF PG BOZ PWFSĕUUJOH DPNNJUUFE CZ UIF ćJT JT XIBU UIF ĕSTU NPEFM MPPLT MJLF JO NBUIFNBUJDBM GPSN OBENJU,J ∼ #JOPNJBM(OJ, QJ) MPHJU(QJ) = α + βN NJ α ∼ /PSNBM(, ) βN ∼ /PSNBM(, ) ćF WBSJBCMF OJ JOEJDBUFT ++'$/$*).ȁ$Ȃ UIF OVNCFS PG BQQMJDB EJDUPS NJ JT B EVNNZ UIBU JOEJDBUFT iNBMFw 8FMM DPOTUSVDU JU KVTU CFG
  41. Compute probabilities • Compute the contrast (difference in probability of

    admission): ćJT DPNQBSJTPO TVHHFTUT UIBU HFOEFS NBUUFST B MPU 5P TFF IPX JU NBUUFST XF IBWF UP MPPL BU FTUJNBUFT GPS N 3 DPEF  +- $.ǿ(ǎǍǡǓȀ  ) / 1 Ǐǡǒʉ ǖǔǡǒʉ  ǶǍǡǕǐ ǍǡǍǒ ǶǍǡǖǐ ǶǍǡǔǐ ( ǍǡǓǎ ǍǡǍǓ ǍǡǑǖ ǍǡǔǑ 4FFNT MJLF CFJOH NBMF JT BO BEWBOUBHF JO UIJT DPOUFYU :PV DBO DPNQVUF UIF SFMBUJWF EJČFS FODF JO BENJTTJPO PEET BT FYQ(.) ≈ . ćJT NFBOT UIBU B NBMF BQQMJDBOUT PEET XFSF  PG B GFNBMF BQQMJDBOUT 0O UIF BCTPMVUF TDBMF XIJDI JT XIBU NBUUFST UIF EJČFSFODF JO QSPCBCJMJUZ PG BENJTTJPO JT 3 DPEF  +*./ ʚǶ 3/-/ǡ.(+' .ǿ (ǎǍǡǓ Ȁ +ǡ($/ǡ(' ʚǶ '*"$./$ǿ +*./ɶ ʔ +*./ɶ( Ȁ +ǡ($/ǡ! (' ʚǶ '*"$./$ǿ +*./ɶ Ȁ $!!ǡ($/ ʚǶ +ǡ($/ǡ(' Ƕ +ǡ($/ǡ! (' ,0)/$' ǿ $!!ǡ($/ Ǣ ǿǍǡǍǏǒǢǍǡǒǢǍǡǖǔǒȀ Ȁ Ǐǡǒʉ ǒǍʉ ǖǔǡǒʉ ǍǡǎǎǐǏǔǔǕ ǍǡǎǑǎǐǒǏǔ ǍǡǎǓǖǐǏǔǑ ćJT NFBOT UIBU UIF NFEJBO FTUJNBUF PG UIF NBMF BEWBOUBHF JT BCPVU  XJUI B  JOUFSWBM GSPN  UP BMNPTU  :PV NBZ BMTP XBOU UP JOTQFDU UIF EFOTJUZ QMPU  ).ǿ$!!ǡ($/Ȁ OPU TIPXO 
  42. 1.6 1.8 2.0 2.2 0 1 2 3 exp(bm) Density

    Odds ratios (relative risk) 0.10 0.14 0.18 0 5 10 15 20 25 30 Pr(Admit|male) - Pr(Admit|female) Density Probability (difference in absolute risk)
  43.  $06/5*/( "/% $-"44*'*$"5*0/ 0.0 0.2 0.4 0.6 0.8 1.0

    case admit 1 2 3 4 5 6 7 8 9 10 11 12 Posterior validation check A B C D E F 'ĶĴłĿIJ Ɖƈƍ 1PTUFSJPS WBMJEBUJPO GPS NPEFM (ǎǍǡǓ #MVF QPJOUT BSF PC TFSWFE QSPQPSUJPOT BENJUUFE GPS FBDI SPX JO UIF EBUB XJUI QPJOUT GSPN UIF TBNF EFQBSUNFOU DPOOFDUFE CZ B CMVF MJOF 0QFO QPJOUT UIF UJOZ WFSUJDBM m f Females admitted more in all but 2 departments! Figure 10.5
  44. Departments vary • Overall admission rates vary a lot across

    departments • Use unique intercepts to control for that variation IJMF JU JT USVF PWFSBMM UIBU GFNBMFT IBE B MPXFS QSPCBCJMJUZ PG BENJTTJPO JO UIF SMZ OPU USVF XJUIJO NPTU EFQBSUNFOUT "OE OPUF UIBU KVTU JOTQFDUJOH UIF Q JPO BMPOF XPVME OFWFS IBWF SFWFBMFE UIBU GBDU UP VT 8F IBE UP BQQFBM UP TPN IF ĕU NPEFM *O UIJT DBTF JU XBT B TJNQMF QPTUFSJPS WBMJEBUJPO DIFDL FBE PG BTLJOH XIBU BSF UIF BWFSBHF QSPCBCJMJUJFT PG BENJTTJPO GPS GFNBMFT BO M EFQBSUNFOUT XF JOTUFBE XBOU UP BTL XIBU JT UIF QSPCBCJMJUZ PG GFNBMF BE EFQBSUNFOU BOE IPX NVDI PO BWFSBHF JT B NBMF NPSF PS MFTT MJLFMZ UP CF B BDI EFQBSUNFOU ćF TUBUJTUJDBM DPOKFDUVSF JT UIBU JG XF BMMPX UIF PWFSBMM QSP TJPO UP WBSZ CZ EFQBSUNFOU UIFO UIF NPEFM XJMM CF BTLJOH B CFUUFS RVFTUJPO UIBU BTLT UIJT OFX RVFTUJPO OBENJU,J ∼ #JOPNJBM(OJ, QJ) MPHJU(QJ) = αıIJĽŁ[J] + βN NJ αıIJĽŁ ∼ /PSNBM(, ) βN ∼ /PSNBM(, ) IJĽŁ JOEFYFT EFQBSUNFOU 4P OPX FBDI EFQBSUNFOU HFUT JUT PXO MPHPEET PG ĽŁ CVU UIF NPEFM TUJMM FTUJNBUFT B VOJWFSTBM BEKVTUNFOU‰TBNF JO BMM EFQBSUN MF BQQMJDBUJPO βN 
  45. Departments vary *OTUFBE PG BTLJOH XIBU BSF UIF BWFSBHF QSPCBCJMJUJFT

    PG BENJTTJ BDSPTT BMM EFQBSUNFOUT XF JOTUFBE XBOU UP BTL XIBU JT UIF QSPCBC JO FBDI EFQBSUNFOU BOE IPX NVDI PO BWFSBHF JT B NBMF NPSF PS XJUIJO FBDI EFQBSUNFOU ćF TUBUJTUJDBM DPOKFDUVSF JT UIBU JG XF BMMP PG BENJTTJPO UP WBSZ CZ EFQBSUNFOU UIFO UIF NPEFM XJMM CF BTLJOH B NPEFM UIBU BTLT UIJT OFX RVFTUJPO OBENJU,J ∼ #JOPNJBM(OJ, QJ) MPHJU(QJ) = αıIJĽŁ[J] + βN NJ αıIJĽŁ ∼ /PSNBM(, ) βN ∼ /PSNBM(, ) XIFSF ıIJĽŁ JOEFYFT EFQBSUNFOU 4P OPX FBDI EFQBSUNFOU HFUT JUT TJPO αıIJĽŁ CVU UIF NPEFM TUJMM FTUJNBUFT B VOJWFSTBM BEKVTUNFOU‰TB GPS B NBMF BQQMJDBUJPO βN  'JUUJOH UIJT NPEFM BMPOH XJUI B WFSTJPO UIBU PNJUT (' JT TU UIF JOEFYJOH OPUBUJPO BHBJO UP DPOTUSVDU BO JOUFSDFQU GPS FBDI EF BMTP OFFE UP DPOTUSVDU B OVNFSJDBM JOEFY UIBU OVNCFST UIF EFQBSU GVODUJPO * - Ǿ$) 3 DBO EP UIJT GPS VT VTJOH UIF  +/ GBDUPS BTU UXP NPEFMT TJPO UIBU NPEFMT ($/ BT B GVODUJPO PG FBDI BQQMJDBOUT HFOEFS UIF BTTPDJBUJPO CFUXFFO HFOEFS BOE QSPCBCJMJUZ PG BENJTTJPO TJPO UIBU NPEFMT ($/ BT B DPOTUBOU JHOPSJOH HFOEFS ćJT XJMM FOTF PG BOZ PWFSĕUUJOH DPNNJUUFE CZ UIF ĕSTU NPEFM MPPLT MJLF JO NBUIFNBUJDBM GPSN OBENJU,J ∼ #JOPNJBM(OJ, QJ) MPHJU(QJ) = α + βN NJ α ∼ /PSNBM(, ) βN ∼ /PSNBM(, ) ++'$/$*).ȁ$Ȃ UIF OVNCFS PG BQQMJDBUJPOT PO SPX J ćF QSF OEJDBUFT iNBMFw 8FMM DPOTUSVDU JU KVTU CFGPSF ĕUUJOH CPUI NPEFMT '$)/ǡ" ) -ʙʙǫ(' ǫ Ǣ ǎ Ǣ Ǎ Ȁ Q: What are the average probabilities of admission for females and males across all departments? Q: What is the average difference in probability of admission for females and males within departments?
  46. Departments vary 'JUUJOH UIJT NPEFM BMPOH XJUI B WFSTJPO UIBU

    PNJUT (' JT TUSBJHIUGPSXBSE 8F UIF JOEFYJOH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/PX UP DPNQBSF

    BMM GPVS NPEFMT GSPN UIJT TFDUJPO 3 DPEF  ,*-/"ǯ *ƾƽǑǃ ǒ *ƾƽǑDŽ ǒ *ƾƽǑDž ǒ *ƾƽǑdž ǰ   -  !  4"&$%1  ! *ƾƽǑDž ǂƿƽƽǑdž ǃ ƽǑƽ ƽǑǂǃ ǂDŽǑƽƿ  *ƾƽǑdž ǂƿƽƾǑǁ DŽ ƽǑǂ ƽǑǁǁ ǂDŽǑƽǃ ƿǑǁDž *ƾƽǑǃ ǂdžǂǁǑDž ƿ DŽǂǀǑdž ƽǑƽƽ ǀǁǑdžDž ǁDžǑǂǀ *ƾƽǑDŽ ǃƽǁǃǑǀ ƾ DžǁǂǑǁ ƽǑƽƽ ƿdžǑdžǂ ǂƿǑǀDŽ ćF OFX NPEFMT ĕU NVDI CFUUFS VOTVSQSJTJOHMZ #VU OPX UIF NPEFM XJUIPVU *)" JT SBOLFE ĕSTU 4UJMM UIF 8"*$ EJČFSFODF CFUXFFO *ƾƽǑDž BOE *ƾƽǑdž JT UJOZ‰CPUI NPEFMT HFU BCPVU IBMG UIF "LBJLF XFJHIU *E DBMM UIJT B UJF 4P UIFSFT NPEFTU TVQQPSU GPS TPNF FČFDU PG HFOEFS FWFO JG JU JT PWFSĕU B MJUUMF 4P MFUT MPPL BU UIF FTUJNBUFT GSPN N BOE TFF IPX UIF FTUJNBUFE BTTPDJBUJPO PG HFOEFS XJUI BENJTTJPO IBT DIBOHFE 3 DPEF  -/" &0ǯ *ƾƽǑdž ǒ !"-1%ʅƿ ǰ "+ 1!"3 ǂǑǂɵ džǁǑǂɵ DZƾDz ƽǑǃDž ƽǑƾƽ ƽǑǂƿ ƽǑDžǁ DZƿDz ƽǑǃǁ ƽǑƾƿ ƽǑǁǂ ƽǑDžƿ DZǀDz ǦƽǑǂDž ƽǑƽDŽ ǦƽǑDŽƽ ǦƽǑǁǃ DZǁDz ǦƽǑǃƾ ƽǑƽdž ǦƽǑDŽǂ ǦƽǑǁDž DZǂDz ǦƾǑƽǃ ƽǑƾƽ ǦƾǑƿƿ ǦƽǑdžƽ
  48. Departments vary   $06/5*/( "/% $-"44*'*$"5*0/ /PX UP DPNQBSF

    BMM GPVS NPEFMT GSPN UIJT TFDUJPO 3 DPEF  ,*-/"ǯ *ƾƽǑǃ ǒ *ƾƽǑDŽ ǒ *ƾƽǑDž ǒ *ƾƽǑdž ǰ   -  !  4"&$%1  ! *ƾƽǑDž ǂƿƽƽǑdž ǃ ƽǑƽ ƽǑǂǃ ǂDŽǑƽƿ  *ƾƽǑdž ǂƿƽƾǑǁ DŽ ƽǑǂ ƽǑǁǁ ǂDŽǑƽǃ ƿǑǁDž *ƾƽǑǃ ǂdžǂǁǑDž ƿ DŽǂǀǑdž ƽǑƽƽ ǀǁǑdžDž ǁDžǑǂǀ *ƾƽǑDŽ ǃƽǁǃǑǀ ƾ DžǁǂǑǁ ƽǑƽƽ ƿdžǑdžǂ ǂƿǑǀDŽ ćF OFX NPEFMT ĕU NVDI CFUUFS VOTVSQSJTJOHMZ #VU OPX UIF NPEFM XJUIPVU *)" JT SBOLFE ĕSTU 4UJMM UIF 8"*$ EJČFSFODF CFUXFFO *ƾƽǑDž BOE *ƾƽǑdž JT UJOZ‰CPUI NPEFMT HFU BCPVU IBMG UIF "LBJLF XFJHIU *E DBMM UIJT B UJF 4P UIFSFT NPEFTU TVQQPSU GPS TPNF FČFDU PG HFOEFS FWFO JG JU JT PWFSĕU B MJUUMF 4P MFUT MPPL BU UIF FTUJNBUFT GSPN N BOE TFF IPX UIF FTUJNBUFE BTTPDJBUJPO PG HFOEFS XJUI BENJTTJPO IBT DIBOHFE 3 DPEF  -/" &0ǯ *ƾƽǑdž ǒ !"-1%ʅƿ ǰ "+ 1!"3 ǂǑǂɵ džǁǑǂɵ DZƾDz ƽǑǃDž ƽǑƾƽ ƽǑǂƿ ƽǑDžǁ DZƿDz ƽǑǃǁ ƽǑƾƿ ƽǑǁǂ ƽǑDžƿ DZǀDz ǦƽǑǂDž ƽǑƽDŽ ǦƽǑDŽƽ ǦƽǑǁǃ DZǁDz ǦƽǑǃƾ ƽǑƽdž ǦƽǑDŽǂ ǦƽǑǁDž DZǂDz ǦƾǑƽǃ ƽǑƾƽ ǦƾǑƿƿ ǦƽǑdžƽ /PX UP DPNQBSF BMM GPVS NPEFMT GSPN UIJT TFDUJPO 3 DPEF  ,*-/"ǯ *ƾƽǑǃ ǒ *ƾƽǑDŽ ǒ *ƾƽǑDž ǒ *ƾƽǑdž ǰ   -  !  4"&$%1  ! *ƾƽǑDž ǂƿƽƽǑdž ǃ ƽǑƽ ƽǑǂǃ ǂDŽǑƽƿ  *ƾƽǑdž ǂƿƽƾǑǁ DŽ ƽǑǂ ƽǑǁǁ ǂDŽǑƽǃ ƿǑǁDž *ƾƽǑǃ ǂdžǂǁǑDž ƿ DŽǂǀǑdž ƽǑƽƽ ǀǁǑdžDž ǁDžǑǂǀ *ƾƽǑDŽ ǃƽǁǃǑǀ ƾ DžǁǂǑǁ ƽǑƽƽ ƿdžǑdžǂ ǂƿǑǀDŽ ćF OFX NPEFMT ĕU NVDI CFUUFS VOTVSQSJTJOHMZ #VU OPX UIF NPEFM XJUIPVU *)" JT SBOLFE ĕSTU 4UJMM UIF 8"*$ EJČFSFODF CFUXFFO *ƾƽǑDž BOE *ƾƽǑdž JT UJOZ‰CPUI NPEFMT HFU BCPVU IBMG UIF "LBJLF XFJHIU *E DBMM UIJT B UJF 4P UIFSFT NPEFTU TVQQPSU GPS TPNF FČFDU PG HFOEFS FWFO JG JU JT PWFSĕU B MJUUMF 4P MFUT MPPL BU UIF FTUJNBUFT GSPN N BOE TFF IPX UIF FTUJNBUFE BTTPDJBUJPO PG HFOEFS XJUI BENJTTJPO IBT DIBOHFE 3 DPEF  -/" &0ǯ *ƾƽǑdž ǒ !"-1%ʅƿ ǰ "+ 1!"3 ǂǑǂɵ džǁǑǂɵ DZƾDz ƽǑǃDž ƽǑƾƽ ƽǑǂƿ ƽǑDžǁ DZƿDz ƽǑǃǁ ƽǑƾƿ ƽǑǁǂ ƽǑDžƿ DZǀDz ǦƽǑǂDž ƽǑƽDŽ ǦƽǑDŽƽ ǦƽǑǁǃ DZǁDz ǦƽǑǃƾ ƽǑƽdž ǦƽǑDŽǂ ǦƽǑǁDž DZǂDz ǦƾǑƽǃ ƽǑƾƽ ǦƾǑƿƿ ǦƽǑdžƽ DZǃDz ǦƿǑǃƿ ƽǑƾǃ ǦƿǑDžDž ǦƿǑǀDŽ * ǦƽǑƾƽ ƽǑƽDž ǦƽǑƿǀ ƽǑƽǀ ćF FTUJNBUF GPS * HPFT JO UIF PQQPTJUF EJSFDUJPO OPX 0O UIF QSPQPSUJPOBM PEET TDBMF UIF FTUJNBUF CFDPNFT FYQ(−.) ≈ . 4P B NBMF JO UIJT TBNQMF IBT BCPVU  UIF PEET PG
  49. With dummies Without 0.0 0.2 0.4 0.6 0.8 1.0 case

    admit 1 2 3 4 5 6 7 8 9 10 11 12 Posterior validation check A B C D E F 'ĶĴłĿIJ ƉƈƎ 1PTUFSJPS WBMJEBUJPO GPS (ǎǍǡǖ ćF VOJRVF JOUFSDFQUT GPS FBDI EFQBSUNFOU " UISPVHI ' DBQUVSF WBSJBUJPO JO PWFSBMM BENJTTJPO SBUFT BNPOH EFQBSUNFOUT ćJT BMMPXT UIF NPEFM UP DPNQBSF NBMF BOE GFNBMF BENJTTJPO SBUFT DPOUSPMMJOH GPS IFUFSPHFOFJUZ BDSPTT EFQBSUNFOUT (ǎǍǡǓ ǒǖǒǑǡǕ Ǐ ǔǒǐǡǖ ǍǡǍǍ ǐǑǡǖǕ ǑǕǡǒǐ (ǎǍǡǔ ǓǍǑǓǡǐ ǎ ǕǑǒǡǑ ǍǡǍǍ Ǐǖǡǖǒ ǒǏǡǐǔ ćF OFX NPEFMT ĕU NVDI CFUUFS VOTVSQSJTJOHMZ #VU OPX UIF NPEFM XJUIPVU (' JT SBOLF ĕSTU 4UJMM UIF 8"*$ EJČFSFODF CFUXFFO (ǎǍǡǕ BOE (ǎǍǡǖ JT UJOZ‰CPUI NPEFMT HFU BCPV IBMG UIF "LBJLF XFJHIU *E DBMM UIJT B UJF 4P UIFSFT NPEFTU TVQQPSU GPS TPNF FČFDU PG HFOEF FWFO JG JU JT PWFSĕU B MJUUMF 4P MFUT MPPL BU UIF FTUJNBUFT GSPN N BOE TFF IPX UIF FTUJNBUF   $06/5*/( "/% $-"44*'*$"5*0/ 0.0 0.2 0.4 0.6 0.8 1.0 case admit 1 2 3 4 5 6 7 8 9 10 11 12 Posterior validation check A B C D E F m f m f
  50. Simpson’s Paradox • Trend reverses when additional predictor added •

    Can indicate confound => win! • Can also indicate collider => lose! https://paulvanderlaken.com/2017/09/27/simpsons-paradox-two-hr-examples-with-r-code/