Dear Statalist users,
I am trying to calculated bootstrapped differences in coefficients across two samples using code that I found on the forum. But I always get an error message.
This is my code for the bootstrapping:
capture program drop bootem
program define bootem, rclass
reghdfe logIC_w treatment_post logSALE_w lagCash_ta_w lagSIZE_w lagDebt_ta_w roa_w Q_w if constraint==1,absorb (fyear#cohort gvkey#cohort)
est store a
reghdfe logIC_w treatment_post logSALE_w lagCash_ta_w lagSIZE_w lagDebt_ta_w roa_w Q_w if constraint==0,absorb (fyear#cohort gvkey#cohort)
est store b
suest a b
lincom [a_mean]_b[treatment_post_new ]-[b_mean]_b[treatment_post_new ]
return scalar diff12 = r(estimate)
end
bootstrap diff = r(diff12), strata(avg_exante_constraint_all) nodrop reps(100) nodots: bootem
And this is the error message I receive:
"unable to generate scores for model a
suest requires that predict allow the score option
an error occurred when bootstrap executed bootem
r(322);"
Thanks,
Annelies
I am trying to calculated bootstrapped differences in coefficients across two samples using code that I found on the forum. But I always get an error message.
This is my code for the bootstrapping:
capture program drop bootem
program define bootem, rclass
reghdfe logIC_w treatment_post logSALE_w lagCash_ta_w lagSIZE_w lagDebt_ta_w roa_w Q_w if constraint==1,absorb (fyear#cohort gvkey#cohort)
est store a
reghdfe logIC_w treatment_post logSALE_w lagCash_ta_w lagSIZE_w lagDebt_ta_w roa_w Q_w if constraint==0,absorb (fyear#cohort gvkey#cohort)
est store b
suest a b
lincom [a_mean]_b[treatment_post_new ]-[b_mean]_b[treatment_post_new ]
return scalar diff12 = r(estimate)
end
bootstrap diff = r(diff12), strata(avg_exante_constraint_all) nodrop reps(100) nodots: bootem
And this is the error message I receive:
"unable to generate scores for model a
suest requires that predict allow the score option
an error occurred when bootstrap executed bootem
r(322);"
Thanks,
Annelies
Comment