I hope this is clear. What I am trying to do is statistically test an outcome between treatment and control groups over a period of 4 years (2 years pre and 2 years post). However, the outcome of interest is a rate, with the numerator as number of survey weighted visits in a given year and the denominator is a merged dataset of state level population in a given year. Perhaps it might help if I display the code used to generate the new outcome variable and a table of the values as a summary of what I am attempting. The challenge I am having is how to test pre/post control/treatment - when I collapse, of course I lose the 200,000 survey observations (and power) by collapsing down to 8 values (treatment/control x4 years). Is there a way to make this statistical comparison without collapsing to maintain the large survey sample and power?
Variables:
- Visits_of_Interest: 0 1 Indicator variable to identify a subpopulation of visits in the treatment/control groups during the 4 years
- Treatment: 0 1 Indicator if the visit occurred in a state that underwent policy change (i.e. treatment)
- Post_Period: 0 1 Indicator assigned to years (2012 & 2013 = 0) (2014 & 2015 = 1)
- State_Adult_Population: Population estimates for each state for each year
- StateWeight: survey weight for state level estimates
- State_ID: Unique State Identifier
Code:
collapse (sum) Visits_of_Interest (mean) Treatment (mean) Post_Period (mean) State_Adult_Population [pw=StateWeight], by(year State_ID)
collapse (sum) Visits_of_Interest (mean) Post_Period (sum) State_Adult_Population, by(year Treatment)
gen Visit_per_Pop = .
replace Visit_per_Pop = Visits_of_Interest/State_Adult_Population
Table of Collapsed Outcome Data
regress Visit_per_Pop i.Post_Period i.Treatment i.Treatment##i.Post_Period
I get output, but is my only option to test at this collapsed level? Can I somehow create the Visit_per_Pop outcome prior to collapsing and maintain the 200,000 survey weighted observations for this state-level intervention?
Thank you for the help!
Aaron
Variables:
- Visits_of_Interest: 0 1 Indicator variable to identify a subpopulation of visits in the treatment/control groups during the 4 years
- Treatment: 0 1 Indicator if the visit occurred in a state that underwent policy change (i.e. treatment)
- Post_Period: 0 1 Indicator assigned to years (2012 & 2013 = 0) (2014 & 2015 = 1)
- State_Adult_Population: Population estimates for each state for each year
- StateWeight: survey weight for state level estimates
- State_ID: Unique State Identifier
Code:
collapse (sum) Visits_of_Interest (mean) Treatment (mean) Post_Period (mean) State_Adult_Population [pw=StateWeight], by(year State_ID)
collapse (sum) Visits_of_Interest (mean) Post_Period (sum) State_Adult_Population, by(year Treatment)
gen Visit_per_Pop = .
replace Visit_per_Pop = Visits_of_Interest/State_Adult_Population
Table of Collapsed Outcome Data
Rate of Visits per Population | ||||
2012 | 2013 | 2014 | 2015 | |
Treatment States | 3.17 | 3.32 | 3.17 | 3.86 |
Control States | 3.36 | 3.13 | 3.09 | 3.24 |
regress Visit_per_Pop i.Post_Period i.Treatment i.Treatment##i.Post_Period
I get output, but is my only option to test at this collapsed level? Can I somehow create the Visit_per_Pop outcome prior to collapsing and maintain the 200,000 survey weighted observations for this state-level intervention?
Thank you for the help!
Aaron