an example analysis using the functions in sts2006_functions.R print first ten and last ten data values: n = 514 x1 x2 x3 z y 1 2.385 1.418 0 1 0 2 2.839 1.098 0 1 0 3 4.422 1.193 0 1 1 4 1.508 1.379 0 0 0 5 4.542 1.323 0 1 0 6 4.409 1.449 1 1 0 7 0.21 1.005 0 0 1 8 4.235 1.032 0 1 0 9 1.504 1.418 0 0 0 10 2.874 1.043 0 1 0 11 . . . . . 504 7.92 1.28 0 1 0 505 0.56 1.479 1 0 1 506 3.334 1.42 0 1 0 507 -0.098 1.205 0 1 0 508 1.27 1.272 0 0 0 509 0.608 1.233 1 0 0 510 1.477 1.407 1 1 0 511 2.522 1.2 1 1 1 512 2.387 1.468 0 1 1 513 3.927 1.344 0 1 1 514 2.848 1.428 0 1 0 summary of the data set x1 x2 x3 z y Min. :-3.3960 Min. :1.003 Min. :0.0000 Min. :0.0000 Min. :0.0000 1st Qu.: 0.8055 1st Qu.:1.118 1st Qu.:0.0000 1st Qu.:1.0000 1st Qu.:0.0000 Median : 2.2695 Median :1.234 Median :0.0000 Median :1.0000 Median :0.0000 Mean : 2.2350 Mean :1.243 Mean :0.2782 Mean :0.7685 Mean :0.3813 3rd Qu.: 3.5878 3rd Qu.:1.359 3rd Qu.:1.0000 3rd Qu.:1.0000 3rd Qu.:1.0000 Max. : 8.9390 Max. :1.498 Max. :1.0000 Max. :1.0000 Max. :1.0000 summary of the propensity score model Call: glm(formula = z ~ x1 + x2 + x3, family = binomial, data = dat) Deviance Residuals: Min 1Q Median 3Q Max -2.4224 0.1036 0.3362 0.6329 2.0401 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 1.34398 1.08635 1.237 0.216 x1 0.80846 0.08584 9.418 < 2e-16 *** x2 -0.84335 0.86565 -0.974 0.330 x3 -1.19095 0.27144 -4.388 1.15e-05 *** --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 556.25 on 513 degrees of freedom Residual deviance: 403.57 on 510 degrees of freedom AIC: 411.57 Number of Fisher Scoring iterations: 5 plotting distribution of the propensity score for each z group... frequency of firms by z within each subclass along the propensity score more thoughtful work could be done here when choosing propensity score strata 0 1 [0,0.4] 40 14 (0.4,0.6] 23 32 (0.6,0.8] 35 71 (0.8,1] 21 278 using the ace.mle() function: an unadjusted/naive estimator and standard error of delta = Pr( r(1)=1 ) - Pr( r(0)=1 ) this analysis suggests no significant difference $acek [1] -0.0286778 $sd0k [1] 0.04497067 $sd1k [1] 0.02435475 $sdk [1] 0.05114211 $tau0 [1] 0.4033613 $sd0 [1] 0.04497067 $tau1 [1] 0.3746835 $sd1 [1] 0.02435475 $ace [1] -0.0286778 $sd.ace [1] 0.05114211 95% confidence interval for the unadjusted mean difference [1] -0.13 0.07 using the ace.mle() function: a propensity score stratified estimator and standard error of delta = Pr( r(1)=1 ) - Pr( r(0)=1 ) this analysis suggests a significant 14 percentage point causal effect $acek 1 2 3 4 0.16785714 0.05978261 0.12152918 0.15930113 $sd0k 1 2 3 4 0.07895806 0.10336653 0.08167346 0.07636035 $sd1k 1 2 3 4 0.12806021 0.08558165 0.05933320 0.02754059 $sdk 1 2 3 4 0.15044531 0.13419708 0.10095039 0.08117505 $tau0 [1] 0.270083 $sd0 [1] 0.04947679 $tau1 [1] 0.4118446 $sd1 [1] 0.02590847 $ace [1] 0.1417616 $sd.ace [1] 0.05584982 95% confidence interval for the propensity score adjusted mean difference this ci may be too small since it does not take into account the error in estimating the propensity score [1] 0.03 0.25 an example sensitivity analysis using the sens.ace.mle() function at various levels of alpha, delta0, delta1, and pi see the paper RR83 for more details alpha delta0 delta1 pi tau1 tau0 ace [1,] 0.5 0.5 0.5 0.1 0.4097 0.2750 0.1347 [2,] 0.5 0.5 0.5 0.9 0.4095 0.2754 0.1341 [3,] 0.5 0.5 2.0 0.1 0.4141 0.2750 0.1390 [4,] 0.5 0.5 2.0 0.9 0.4141 0.2754 0.1388 [5,] 0.5 2.0 0.5 0.1 0.4097 0.2663 0.1435 [6,] 0.5 2.0 0.5 0.9 0.4095 0.2635 0.1460 [7,] 0.5 2.0 2.0 0.1 0.4141 0.2663 0.1478 [8,] 0.5 2.0 2.0 0.9 0.4141 0.2635 0.1506 [9,] 2.0 0.5 0.5 0.1 0.4141 0.2635 0.1506 [10,] 2.0 0.5 0.5 0.9 0.4141 0.2663 0.1478 [11,] 2.0 0.5 2.0 0.1 0.4095 0.2635 0.1460 [12,] 2.0 0.5 2.0 0.9 0.4097 0.2663 0.1435 [13,] 2.0 2.0 0.5 0.1 0.4141 0.2754 0.1387 [14,] 2.0 2.0 0.5 0.9 0.4141 0.2750 0.1391 [15,] 2.0 2.0 2.0 0.1 0.4095 0.2754 0.1341 [16,] 2.0 2.0 2.0 0.9 0.4097 0.2750 0.1347 balance diagnostic statistics before stratification $essentials B R1 R2.x1 R2.x2 R2.x3 1.3443539 0.5175682 1.3764000 1.2228000 0.7397000 $details $details$overall.results [,1] D 0.2891 Tstat 11.8818 Tpval 0.0000 Zstat 14.1229 B 1.3444 R1 0.5176 $details$covariate.results Diffs Tstats Zstats Bs R1s R2s x1 2.2383 13.2542 12.0893 1.3210 1.4112 1.3764 x2 -0.0076 -0.5310 -0.5043 -0.0541 1.2121 1.2228 x3 -0.1629 -3.2551 -3.5101 -0.3529 0.7545 0.7397 balance diagnostic statistics within each strata ******************************** strata 1 ********** $essentials B R1 R2.x1 R2.x2 R2.x3 0.0907108 0.9627582 1.0406000 1.6763000 1.0325000 $details $details$overall.results [,1] D 0.0089 Tstat 0.2935 Tpval 0.7718 Zstat 0.2907 B 0.0907 R1 0.9628 $details$covariate.results Diffs Tstats Zstats Bs R1s R2s x1 0.2410 0.6827 0.7491 0.2214 1.4634 1.0406 x2 0.0027 0.0557 0.0617 0.0181 1.5277 1.6763 x3 0.0929 0.5993 0.5954 0.1855 0.9740 1.0325 B R1 R2.x1 R2.x2 R2.x3 0.0907108 0.9627582 1.0406000 1.6763000 1.0325000 ******************************** strata 2 ********** $essentials B R1 R2.x1 R2.x2 R2.x3 0.07439661 0.71922404 1.31550000 1.23440000 1.14580000 $details $details$overall.results [,1] D 0.0041 Tstat 0.2686 Tpval 0.7895 Zstat 0.2760 B 0.0744 R1 0.7192 $details$covariate.results Diffs Tstats Zstats Bs R1s R2s x1 0.1174 0.5992 0.5846 0.1618 1.3490 1.3155 x2 -0.0065 -0.1660 -0.1631 -0.0450 1.2364 1.2344 x3 0.0707 0.5390 0.5350 0.1468 1.0930 1.1458 B R1 R2.x1 R2.x2 R2.x3 0.07439661 0.71922404 1.31550000 1.23440000 1.14580000 ******************************** strata 3 ********** $essentials B R1 R2.x1 R2.x2 R2.x3 0.2752086 0.9299572 0.9886000 1.1898000 0.9130000 $details $details$overall.results [,1] D 0.0162 Tstat 1.3244 Tpval 0.1900 Zstat 1.3410 B 0.2752 R1 0.9300 $details$covariate.results Diffs Tstats Zstats Bs R1s R2s x1 0.0168 0.1012 0.1036 0.0211 0.8746 0.9886 x2 -0.0114 -0.3900 -0.3785 -0.0793 1.1907 1.1898 x3 -0.0475 -0.4750 -0.4814 -0.0987 0.9243 0.9130 B R1 R2.x1 R2.x2 R2.x3 0.2752086 0.9299572 0.9886000 1.1898000 0.9130000 ******************************** strata 4 ********** $essentials B R1 R2.x1 R2.x2 R2.x3 1.192671 1.577672 1.066000 1.271800 0.685200 $details $details$overall.results [,1] D 0.0581 Tstat 5.8652 Tpval 0.0000 Zstat 4.8231 B 1.1927 R1 1.5777 $details$covariate.results Diffs Tstats Zstats Bs R1s R2s x1 1.0993 5.3349 3.5714 0.9505 2.5870 1.0660 x2 0.0041 0.1415 0.1272 0.0303 1.2804 1.2718 x3 -0.1023 -0.9865 -1.1490 -0.2395 0.7016 0.6852 B R1 R2.x1 R2.x2 R2.x3 1.192671 1.577672 1.066000 1.271800 0.685200 balance diagnostic statistics overall (before and after) final summary B R1 R2.x1 R2.x2 R2.x3 before 1.34435388 0.5175682 1.376400 1.222800 0.739700 strata 1 0.09071079 0.9627582 1.040600 1.676300 1.032500 strata 2 0.07439661 0.7192240 1.315500 1.234400 1.145800 strata 3 0.27520860 0.9299572 0.988600 1.189800 0.913000 strata 4 1.19267055 1.5776716 1.066000 1.271800 0.685200 after 0.76803658 1.2876372 1.074067 1.293384 0.817951 end of file