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/