Dear Stata users,
I have a cross-sectional datatset on all cities in the United States (n=35,933), which is the entire population of interest in this study. My goal is to estimate the effect of a state law X on a city level outcome Y. The law varies from state to state (and no two states are the same), but it is constant for all cities within each state. X is a continuous index, Y is log-transformed total size of city budget in dollars.
There are theoretical reasons to believe that the effect of the law X will be different for different values of Y. Thus, in addition to OLS regression, I would like to estimate quantile regressions. The cities are grouped into clusteres (i.e. into 50 states), so I need to account for that. It seems that Stata has two potential solutions, -bsqreg- and user-written - qreg2-. Below is the code I use to implement this, where stid is a variable for state id's.
My main question stems from the fact that the two functions provide somewhat different findings and I am not sure which one is more trustworthy. Results from -bsqreg- find significant association between X and Y the further away we move from the median in either direction (i.e. for upper and lower quantiles), whereas qreg2 does not.
In that regard, given that i have the entire population of interest, can i trust the results from -bsqreg- estimation and why? I have read somewhere a while ago that the main challenge with bootstrapped estimation is that it is time and resource consuming, and that's where qreg2 comes in handy. I, of course, would not mind the computer running for a day or so if the outcomes os more interesting and valuable results.
I am using Stata/SE 13.1 on Windows 10 x64.
Thank you
I have a cross-sectional datatset on all cities in the United States (n=35,933), which is the entire population of interest in this study. My goal is to estimate the effect of a state law X on a city level outcome Y. The law varies from state to state (and no two states are the same), but it is constant for all cities within each state. X is a continuous index, Y is log-transformed total size of city budget in dollars.
There are theoretical reasons to believe that the effect of the law X will be different for different values of Y. Thus, in addition to OLS regression, I would like to estimate quantile regressions. The cities are grouped into clusteres (i.e. into 50 states), so I need to account for that. It seems that Stata has two potential solutions, -bsqreg- and user-written - qreg2-. Below is the code I use to implement this, where stid is a variable for state id's.
Code:
set seed 10101 foreach q in 10 25 50 75 90 { bsqreg Y X $controls, q(`q') reps(1000) eststo BSQR_`q' qreg2 Y X $controls, q(`q') c(stid) eststo QR_`q' }
In that regard, given that i have the entire population of interest, can i trust the results from -bsqreg- estimation and why? I have read somewhere a while ago that the main challenge with bootstrapped estimation is that it is time and resource consuming, and that's where qreg2 comes in handy. I, of course, would not mind the computer running for a day or so if the outcomes os more interesting and valuable results.
I am using Stata/SE 13.1 on Windows 10 x64.
Thank you
Comment