Hi everyone,
I'm getting errors when I run the following
No bootstrap repetition is valid and I get the insufficient observations to compute bootstrap standard errors no results will be saved message. When I use the noisily option the estimation with data as is works perfectly but then I get the following in each repetition:
Is this because I generate my own data? Or do I have anything wrong in my code? Any help is really appreciated.
I'm getting errors when I run the following
Code:
set obs 10000 set seed 14051969 gen age = floor((65-18)*runiform() + 18) gen income = exp(0.005 * age + rnormal(10.31,0.60))/1000 label var income "Income ($ Thousands)" gen dstar = 2 + 0.25 * income + rnormal(0,2) gen dy = income > 20 gen donations = dy * dstar sum tobit donations income, ll ** Two-part probit and regress capture program drop boot_twostep program define boot_twostep, rclass probit dy age predict dylin, xb scalar gage = _b[age] regress donations income if donations > 0 predict inclin, xb scalar binc = _b[inc] * age gen pe1 = normalden(dylin)*inclin*gage * income gen pe2 = normal(dylin)*binc sum pe1 return scalar ape1 = r(mean) sum pe2 return scalar ape2 = r(mean) drop dylin inclin pe1 pe2 end bootstrap r(ape1) r(ape2): boot_twostep
Code:
. boot_twostep
outcome does not vary; remember:
0 = negative outcome,
all other nonmissing values = positive outcome
an error occurred when bootstrap executed boot_twostep, posting missing values
Comment