I am running 40 regressions. In each regression I regress an indicator for having price at least as great as a certain value (e.g. 0, 2500, 5000, 7500,..., 100000) on one variable of interest. Now I would like to plot the 40 coefficients from each regression in the same graph, have the price as the X-axis, and each coefficient with the 95% confidence interval should be exactly above the price for which the indicator is used as the outcome variable. So the coefficient with the 95% confidence interval from a regression of having price at least as great as 0 should be above 0, the coefficient with the 95% confidence interval from a regression of having price at least as great as 2500 should be above 2500 and so on. I have tried coefplot but I can't add a continuous X-axis. However I definitely need a continuous X-Axis because I want to add vertical lines at certain price levels and I want to control how many labels will be on the X-axis. Here is an example for the first six regressions how the graph should look like.
Array
Here is a simple code how I run the regressions using the auto data set:
Code:
sysuse auto
foreach n of numlist 3000 3500 4000 4500 5000 5500 6000 6500 7000 {
gen price_`n'=(price>`n')
}
foreach dv in price_3000 price_3500 price_4000 price_4500 price_5000 price_5500 price_6000 price_6500 price_7000 {
eststo `dv': reg `dv' weight
}
0 Response to Two-Way Coefplot
Post a Comment