Code:
sysuse auto, clear cap prog drop myboot prog define myboot, rclass reg3 ( price mpg) ( weight length) sca Pricempg = [price]mpg reg3 ( price mpg) ( weight length) if foreign==1 return sca Diff = Pricempg - [price]mpg end bootstrap Diff=r(Diff), reps(100) : myboot
Code:
. bootstrap Diff=r(Diff), reps(100) : myboot (running myboot on estimation sample) Bootstrap replications (100) ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 .................................................. 50 .................................................. 100 Bootstrap results Number of obs = 22 Replications = 100 command: myboot Diff: r(Diff) ------------------------------------------------------------------------------ | Observed Bootstrap Normal-based | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Diff | 20.35371 . . . . . ------------------------------------------------------------------------------ .
(This issue originated in the thread
https://www.statalist.org/forums/for...nts-after-reg3
I could not figure it out there, hence I am repeating it here with hopefully more informative title of the post)
0 Response to What is wrong with my bootstrap program, and why does it give the same estimates in every bootstrap sample?
Post a Comment