24
Stata Technical Bulletin
STB-4
display (_b [XX] -7._orb) / (_b [XX] ∕sqrt (.result (6) ) )
* Previous four lines display the original-sample regression slope
* (.orb), original-sample standard error (.orSE), bootstrap
* regression slope, and bootstrap studentized slope,
log off
macro define .bsample=%.bsample+l
>
log close
drop .all
infile orb orSE bootb stub using bstemp.log
save mcit%.mcit, replace
* Each Monte Carlo iteration saves a dataset containing
* results from 2,000 resamplings,
macro define .mcit=%.mcit+l
>
macro define .mcit=l
capture erase mctemp.log
log using mctemp.log
log off
while %.mcit<101 -(
quietly use mcit%.mcit, clear
log on
display %.mcit
quietly summ orb
display .result(3)
quietly summ orSE
display .result(3)
quietly summ bootb, detail
display .result(3)
display sqrt(.result(4))
display .result(7)
display .result(13)
quietly summ stub, detail
display .result(7)
display .result(13)
display
log off
* Preceding lines display the Monte Carlo sample number, original-sample
* slope and standard error, bootstrap mean and standard deviation of
* regression slope; and bootstrap percentiles and studentized percentiles,
macro define .mcit=%.mcit+l
>
log close
drop .all
infile iterate orb orSE bootb bootSE p05 p95 t05 t95 ∕*
*/ using mctemp.log;
label variable orb "original sample b coefficient"
label variable orSE "original sample SE of b"
label variable bootb "mean bootstrap b coefficient"
label variable bootSE "SD of bootstrap b coefficient"
label define correct 0 "wrong" 1 "correct"
*
generate stanlo=orb-l.665*orSE
generate stanhi=orb+l.665*orSE
generate Stanwide=Stanhi-Stanlo
label variable Stanwide "width standard t interval"
generate Stancor=O
replace Stancor=I if stanlo<3 & 3<stanhi
label variable Stancor "standard 90% c.i. correct?"
label values Stancor correct
*
generate perwide=p95-p05
label variable perwide "width 5th-95th percentile"
generate percor=0
replace percor=l if p05<3 & 3<p95
label variable percor "percentile 90% c.i. correct?"
label values percor correct
*
generate hyblo=orb-(p95-orb)
generate hybhi=orb-(p05-orb)
generate hybwide=hybhi-hyblo
label variable hybwide "width hybrid percentile interval"
generate hybcor=0
replace hybcor=l if hyblo<3 & 3<hybhi
More intriguing information
1. An Incentive System for Salmonella Control in the Pork Supply Chain2. The name is absent
3. Skills, Partnerships and Tenancy in Sri Lankan Rice Farms
4. The Importance of Global Shocks for National Policymakers: Rising Challenges for Central Banks
5. Economies of Size for Conventional Tillage and No-till Wheat Production
6. A Rational Analysis of Alternating Search and Reflection Strategies in Problem Solving
7. The Evolution
8. The name is absent
9. Name Strategy: Its Existence and Implications
10. Demand Potential for Goat Meat in Southern States: Empirical Evidence from a Multi-State Goat Meat Consumer Survey