I have to conduct a DID analysis to examine the effect of an intervention/treatment on the prevalence of smoking using a national cross-sectional survey dataset (2010-2018). The outcome of interest is a binary variable (smoking: yes/no), and I am comparing states with and without the policy of interest.
I have to run both a linear probability model and a logit model to examine the effect of the policy for males in treated versus reference states. The sample code I have is outlined below.
Linear probability model (estimation of probability differences among males in treated versus reference states)
Code:
/*Question 1: Is the DID estimate (i.e., average difference in the probability of smoking) simply the coefficient of the interaction term? If not, do how do I obtain the DID estimate?*/ svy, subpop(if gender==1): reg smoking i.intervention_flag##i.pre_post_flag
Logit model (estimation of changes in the odds ratio among males in treated versus reference states)
Code:
/*Question 2: Is the DID estimate (i.e, changes in the odds of smoking) simply the odds ratio of the interaction term? If not, how do I obtain the DID estimate as an odds ratio?*/ svy, subpop(if gender==1): logit smoking i.intervention_flag##i.pre_post_flag, or /*Question 3: does this code provide the average difference-in-difference in the probability of smoking? If so, would we expect the results to be similar to the coefficient of the interaction term in the linear probability model outlined above?*/ margins intervention_flag, dydx(pre_post_flag) pwcompare
a) pre versus post policy period for males in treated states; b) pre versus post policy period for males in reference states
If so, how would I program that in STATA?
I am very new to STATA and I am learning how to conduct a DID analysis, so I appreciate any insight you can offer.
0 Response to How do you conduct a difference-in-difference analysis for a binary outcome?
Post a Comment