Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: how to bootstrap the difference of two sample means


From   "Joseph Coveney" <[email protected]>
To   "Statalist" <[email protected]>
Subject   Re: st: how to bootstrap the difference of two sample means
Date   Mon, 12 Jul 2004 17:26:08 +0900

Shourun Guo wrote:

>What I want to do is as follows. I have a sample of size N and a matching
>sample of size N. Say the variable I care is x. I want to test the
>significance of  the difference of the mean and the difference of the
>median between the two samples. But because the distibution of x is skewed,
>the conventional t-test or z-test is not good here. I am following
>literature, trying to use bootstrap to do it.
>
>Basically, the procedure is first to pool the two sample to get a size 2N
>sample. Then randomly draw with replacement a sample of size N, get the
>mean and median. Then draw another one. Then calculate the difference. And
>repeat the above drawing and calculation 1000 times. And I will get the
>ditribution of the 1000 difference and can do the inference with them.
>
>My question is how to write the Stata program to let it draw 2 random
>samples in each bootstrap replication.

----------------------------------------------------------------------------

I'm not sure that I follow you, but if you're anxious about skew,
perhaps -permute- with -ttest- might assuage your concerns.  For an
assessment of the difference between two sample medians, perhaps -cendif-
or -npshift- (location paramter shift) would help.

Joseph Coveney



*
*   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/



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