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

st: how to bootstrap the difference of two sample means


From   Shourun Guo <[email protected]>
To   [email protected]
Subject   st: how to bootstrap the difference of two sample means
Date   Sun, 11 Jul 2004 22:23:51 -0400

I need some help on the bootstrap procedure either of version 7 or version 8.

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.

Thank you for your help.
*
*   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