* rct.do March 2022 For Stata version 17 log using rct.txt, text replace // Save results in a log file ********** OVERVIEW OF rct.do ********** * This is an example of a randomized control trial * Program by A. Colin Cameron Dept. of Economics Univ. of California - Davis * Used for ECN 190 Research with Economics Data * To run you need file * AED_HEALTHINSEXP.DTA * in your directory * The dataset is used in chapter 13.5 of * A. Colin Cameron Analysis of Economics Data: An Introduction to Econometics * https://cameron.econ.ucdavis.edu/ * Original source is Aviva Aron-Dine, Liran Einav, and Amy Finkelstein (2013), * "The RAND Health Insurance Experiment, Three Decades Later", * Journal of Economics Perspectives, 27(1), pages 197-222. * Data at http://doi.org/10.3886/E113919V1 ********** SETUP ********** clear all set scheme s1mono /* Graphics scheme */ ************ RANDOMIZED CONTROL TRIAL use AED_HEALTHINSEXP.DTA, clear * Restrict to year 1 keep if year==1 describe summarize tab plan * Correct some mistakes in the labelling of variables label variable coins25 "= 1 if 25% coinsurance and = 0 otherwise" label variable coinsmixed "= 1 if 25%/50% mix coinsurance and = 0 otherwise" describe spending coins0 coins25 coinsmixed coins50 coinsindiv coins95 /// coinsrate mde spending oop summarize spending plan year coins0 coins25 coinsmixed coins50 coinsindiv coins95 /// coinsrate mde oop * Note here that plan is not ordered by coinsurance rate bysort plan: sum spending table plan, stat(mean spending) nformat(%10.0f) * Mean spending by increasing coinsurance rate regress spending coins0 coins25 coinsmixed coins50 coinsindiv coins95, /// vce(cluster idfamily) noconstant noheader * Difference in two means: freecare (coins0=1) versus any other (coins0=0) ttest spending, by(coins0) unequal reverse * Difference in two means: using OLS regression regress spending coins0, vce(robust) * Difference in two means: using OLS regression and cluster-robust standard errors regress spending coins0, vce(cluster idfamily) * Difference in mean spending compared to 0% coinsurance (free care) regress spending coins25 coinsmixed coins50 coinsindiv coins95, /// vce(cluster idfamily) noheader test coins25 coinsmixed coins50 coinsindiv coins95 * Add some regressors global xlist age gender badhealth goodhealth regress spending coins25 coinsmixed coins50 coinsindiv coins95 $xlist, /// vce(cluster idfamily) test coins25 coinsmixed coins50 coinsindiv coins95 ********** CLOSE OUTPUT log close