[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: R: R: bootstrapped p-values

From   "Carlo Lazzaro" <>
To   <>
Subject   Re: st: R: R: bootstrapped p-values
Date   Sun, 7 Dec 2008 18:36:38 +0100

Dear Richard,
your concern is conceivable, since to my real shame I have misreported two
bits of the code. Sorry for this.
I do hope that everything will work fine this time.
Kind Regards and have a Nice Sunday,

---------------------------begin example---------------------------
sysuse auto
save "C:\Documents and
Settings\carlo\Documenti\Statistiche\Stata\Richard_1.dta", replace ttest
mpg, by(foreign) unequal scalar tobs=r(t) sum mpg, mean scalar omean=r(mean)
sum mpg if foreign==0, mean replace mpg = mpg-r(mean) + scalar(omean)  if
foreign==0 sum mpg if foreign==1, mean replace mpg = mpg-r(mean) +
scalar(omean)  if foreign==1 sort foreign by foreign: sum mpg keep mpg
foreign set seed 1 bootstrap t=r(t), reps(1000) nodots strata(foreign)
saving(C:\Documents and
Settings\carlo\Documenti\Statistiche\Stata\Richard_2.dta, every(1)
replace)verbose : ttest mpg, by(foreign) unequal save "C:\Documents and
Settings\carlo\Documenti\Statistiche\Stata\Richard_1.dta", replace use
"C:\Documents and Settings\carlo\Documenti\Statistiche\Stata\Richard_2.dta",
clear generate indicator =abs(t)>=abs(scalar(tobs)) sum indicator, mean
display "ASLboot="r(mean) 
------------------------------end example----------------------------

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index