Ok, thanks to Nick Winters, I have learned something new about the "return list" command. I ran that after the conventional command
ttest prert=postrt / *and none of the returned values contain the mean(diff). So instead, I did the following*/
gen diff=prert-postrt /* to obtain the paired-difference */
bs "ttest diff=0" "r(mu_1)", reps(50) size(10)
command: ttest diff=0
statistic: r(mu_1)
Warning: Since ttest is not an estimation command or does not set e(sample), bs has no way to determine
which observations are used in calculating the statistics and so assumes that all observations
are used. This means no observations will be excluded from the resampling due to missing values
or other reasons.
If the assumption is not true, press Break, save the data, and drop the observations that are to
be excluded. Be sure the dataset in memory contains only the relevant data.
(obs=26)
Bootstrap statistics
Variable | Reps Observed Bias Std. Err. [95% Conf. Interval]
---------+-------------------------------------------------------------------
bs1 | 50 .0077458 -.0008057 .0091473 -.0106365 .026128 (N)
| -.008683 .0249181 (P)
| -.0056496 .0270643 (BC)
-----------------------------------------------------------------------------
N = normal, P = percentile, BC = bias-corrected
I think I obtained what I am after (i.e. 95% Conf. Interval for the mean-difference by the methods N, P and the bias-corrected one) - I am not sure of the implications of the warning message STATA is telling.
Many thanks for your help in advance.
Regards,
Amani
-----Original Message-----
From: Steichen, Thomas [mailto:[email protected]]
Sent: 12 June 2002 18:25
To: [email protected]
Subject: st: RE: RE: Bootstrapping and t-tests
ttest does not return a statistic called _b[anything].
What statistic are you trying to bootstrap? r(mu_1)-r(mu_2) seems a possibility.
Also, n() is not an option for bs. Did you mean size()?
Tom
> -----Original Message-----
> From: Siyam,AA (pgr) [mailto:[email protected]]
> Sent: Wednesday, June 12, 2002 1:07 PM
> To: [email protected]
> Subject: st: RE: Bootstrapping and t-tests
>
>
> Sorry that was a typing error of mine - still the error
> message I get tells me:
>
> bs "ttest prert=postrt" "_b[prert] _b[postrt]", reps(50) n(10)
> command: ttest prert=postrt
> statistics: _b[prert] _b[postrt]
> error in statistic: _b[prert]
> r(198);
>
>
> -----Original Message-----
> From: Lee Sieswerda [mailto:[email protected]]
> Sent: 12 June 2002 17:56
> To: '[email protected]'
> Subject: st: RE: Bootstrapping and t-tests
>
>
> At the least, you are missing the right-most square bracket.
> That is, it
> should be _b[postrt] .
>
>
> > -----Original Message-----
> > From: Siyam,AA (pgr) [SMTP:[email protected]]
> > Sent: Wednesday, June 12, 2002 12:54 PM
> > To: [email protected]
> > Subject: st: Bootstrapping and t-tests
> >
> > Dear colleagues,
> >
> > Is possible to run a bootstrapped t-test on the paired-observation
> > variables preert and postrt. I tried the command line below
> >
> > bs "ttest preert=postrt" "_b[preert] _b[postrt", reps(50) n(10)
> >
> > The error message I am getting says:
> > error when command executed on original dataset
> > invalid syntax
> > r(111);
> >
> > Many thanks for your help in advance.
> >
> > Regards,
> > Amani
> > *
> > * For searches and help try:
> > * http://www.stata.com/support/faqs/res/findit.html
> > * http://www.stata.com/support/statalist/faq
> > * http://www.ats.ucla.edu/stat/stata/
> *
> * For searches and help try:
> * http://www.stata.com/support/faqs/res/findit.html
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
> *
> * For searches and help try:
> * http://www.stata.com/support/faqs/res/findit.html
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/