Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Bootstrap resampling across a subset of data


From   George Murray <[email protected]>
To   [email protected]
Subject   st: Bootstrap resampling across a subset of data
Date   Thu, 19 Sep 2013 21:01:52 +1000

Dear Statalist,

Suppose I have dataset in the following form:

I have 3 variables, Time / Var1 / Var2, with time going from t=1 to
100. Var1 has no missing observations, but Var2 only has observations
from t=26 to t=75 inclusive.

I want to create 1000 bootstrap samples (sample with replacement) of
Var2 from t=26 to t=75 *only*, and create a new variable for each of
the samples, which will contain 50 observations each. So for each of
these bootstrap samples, there will be missing values at
t=1,…,25,76,…,100; and t=26 to 75 will contain the draws from a given
sample (with replacement) of the 50 non-missing observations in Var2.

So the final dataset should have Time / Var1 / Var2 (as before) as
well as 1000 new columns denoting each bootstrap sample of Var2. Sorry
if this is obvious, I’m new to resampling and the help file wasn’t
relevant to this.

Thank you.

George.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index