Hikaru Goto
June 25, 2016
1.9k

# 統計的因果推論勉強会　第2回

June 25, 2016

## Transcript

5

܏޲είΞ 6

10. ### ٶ઒ຊɹୈ2ষ • ڧ͍ҙຯͰͷແࢹՄೳੑʢٶ઒ຊʣ • ڧ͘ແࢹͰ͖ΔׂΓ౰ͯ৚݅ʢ੕໺ຊʣ ʮׂΓ౰ͯ͸͋͘·ͰڞมྔʹͷΈґଘ͠ɼ݁Ռม ਺ʹ͸ґଘ͠ͳ͍ʯʢ43ทʣ • ແ࡞ҝׂΓ෇͚ͬΆ͘͢Δ •

Ͳ͏͍͏ͱ͖ʹڧ͍ҙຯͰແࢹՄೳͰ͋Δ͔͸౷ ܭ෼ੳ͚ͩͰ͸Θ͔Βͳ͍ɻ 10

12. ### ੕໺ຊɹୈ2ষ • ൓࣮Ծ૝Ϟσϧʗજࡏ൓ԠϞ σϧ counterfactual model potential outcomes model •

΋͠΋ͷ͓࿩ɻ྆ํͱ΋஋͕ ଘࡏ͢Δ͸ͣɻͰ΋ɼ࣮ࡍ͸ Ұํ͔͠؍ଌ͞Εͳ͍ • ౷ܭతҼՌਪ࿦͸ܽଌͷσʔ λΛ෼ੳ͢Δ͜ͱ 12

͔ʯ 20

23. ### ී௨ʹtݕఆʢ༗ҙࠩͳ͠ʣ #ͱΓ͋͑ͣ܈ผͰฏۉΛݟͯΈΔɻ > by(dat[,"happy"], dat[,"promote"], mean) dat[, "promote"]: ঢਐͳ͠ [1]

2.853333 ------------ dat[, "promote"]: ঢਐ͋Γ [1] 4.48 #tݕఆ > t.test(promote0\$happy, promote1\$happy) Welch Two Sample t-test data: promote0\$happy and promote1\$happy t = -2.2515, df = 6.6525, p-value = 0.06101 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -3.35328611 0.09995278 sample estimates: mean of x mean of y 2.853333 4.480000 23
24. ### ܏޲είΞͰϚονϯά #܏޲είΞΛग़͢ɻ ps_score <- glm(promote ~ gender + commu +

sales, family = binomial, data = dat2) #ϚονϯάʹඞཁͳσʔλΛऔΓग़͢ɻ dat\$keikou.score <- ps_score\$fitted.values keikou.score <- ps_score\$fitted.values happy <- dat2\$happy warituke <- dat2\$promote #ϚονϯάͰ2܈ͷฏۉͷࠩΛݟΔɻ kekka <- Match(Y=happy, Tr=warituke, X=keikou.score, M=1) summary(kekka) • ATE Ͱ͸ͳ͘ ATT(TET) Ͱ͢ɻ 24
25. ### ༗ҙͳ͕ࠩݟΒΕΔɻ > summary(kekka) Estimate... 2.2 AI SE...... 0.90173 T-stat..... 2.4398

p.val...... 0.014697 Original number of observations.............. 20 Original number of treated obs............... 5 Matched number of observations............... 5 Matched number of observations (unweighted). 5 • ঢਐʹΑͬͯ޾෱౓͕ߴ·Δʢ΢ιʣ 25
26. ### ͲΜͳ૊Έ߹Θ͔ͤͩͬͨʁ • ͔ͨ͠ʹ܏޲είΞ͕͍ۙϚονϯά > kekka\$index.treated [1] 16 17 18 19

20 > kekka\$index.control [1] 4 6 12 3 12 26