stcox (Cox Proportional Hazard Model), and exponential and weibull regressions estimate a hazard rate. The models do not contain the dependent variable in the command line (i.e., only the independent variables are listed for estimation procedure). The dependent variable is listed after the time ordering term in the “stset” (survival set) command. Thus, in the commands that follow the data were stacked by state per year (i.e., a series of consecutive years on one state and then a series of consecutive years on the next state, etc.) and dependent variable in all the analyses was “eitc” (whether the state had an eitc program in that year. The time line for a state ended the first year they adopted the program (i.e., no scores on the dependent variable after that year). A “failure” was coded “1” (i.e., the state adopted an eitc in that year) or “0” (the state did not adopt an eitc in that year).
The “cluster” option is used on the end of one of the Cox Proportional Hazard models because it was suggested that the accuracy of the error could be improved by clustering by state. The cluster command produces robust standard errors. The “do” file for these commands appears below.
use c:/statepoliticaldata1880to2008, clear
stset year, failure(eitc)
stcox lhdem uhdem demgov top1
stcox lhdem uhdem demgov top1, cluster(state)
streg lhdem uhdem demgov top1, dist(exponential)
streg lhdem uhdem demgov top1, dist(weibull)
: in the exponential and weibull regressions the “dist” stands for “distribution.” Also, you can use the cluster command with either the exponential or weibull regressions. Thus, the following would be “okay”:
streg lhdem uhdem demgov top1, dist(exponential) cluster(state)
You can avoid much unnecessary convergence output by putting “nolog” and “no show” after the commands. Thus,
stcox lhdem uhdem demgov top1, nolog noshow
or: stcox lhdem uhdem demgov top1, cluster(state) nolog noshow