Hi all,
I am bootstrapping a ratio I calculate using several regression estimates from different equations. The objective is to calculate bootstrap standard errors and confidence intervals for that ratio.
The problem I have is that the bootstrap procedure yields a lot of failed replications providing the message: collinearity in replicate sample is not the same as the full sample, posting missing values insufficient observations to compute bootstrap standard errors no results will be saved.
I am sure the problem comes from the inclusion of fixed effects in the estimations since when I exclude them I don't get failed replications anymore. However, I am not sure why I get problems with fixed effects since I am specifying block bootstrapping by means of the cluster() option and I am making sure that there is a new variable to identify the bootstrap clusters in each replication by using the id() option.
Using this options should make sure that there is no more than one unit with the same identificator in the bootstrap replications, so I am not sure why I am getting the error. Any help is more than welcome.
Find the code I am using below: (originally I used "xtset nohouse year" but I have "xtset id year" at the beginning of my program to make sure the new identificator is used for the bootstrap reps)
I am bootstrapping a ratio I calculate using several regression estimates from different equations. The objective is to calculate bootstrap standard errors and confidence intervals for that ratio.
The problem I have is that the bootstrap procedure yields a lot of failed replications providing the message: collinearity in replicate sample is not the same as the full sample, posting missing values insufficient observations to compute bootstrap standard errors no results will be saved.
I am sure the problem comes from the inclusion of fixed effects in the estimations since when I exclude them I don't get failed replications anymore. However, I am not sure why I get problems with fixed effects since I am specifying block bootstrapping by means of the cluster() option and I am making sure that there is a new variable to identify the bootstrap clusters in each replication by using the id() option.
Using this options should make sure that there is no more than one unit with the same identificator in the bootstrap replications, so I am not sure why I am getting the error. Any help is more than welcome.
Find the code I am using below: (originally I used "xtset nohouse year" but I have "xtset id year" at the beginning of my program to make sure the new identificator is used for the bootstrap reps)
Code:
program myboot, rclass xtset id year qui xtreg leisure unemp $controls, fe sum leisure scalar x=(r(mean)+_b[unemp])/r(mean) qui xtreg cook unemp $controls, fe sum cook scalar k=r(mean)/(r(mean)+_b[unemp]) qui xtreg food_out_hh unemp $controls, fe sum food_out_hh scalar z=r(mean)/(r(mean)+_b[unemp]) return scalar ratio=log(x)/(log(z)-log(k)) display ratio end bootstrap ratio=r(ratio), cluster(nohouse) idcluster(id) reps(1000) seed(12345): myboot
Comment