Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: Resampling a vector with replacement


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Resampling a vector with replacement
Date   Fri, 2 Mar 2012 09:08:45 +0000

Worksheet here presumably means dataset. Vector may mean vector
although I guess you really mean variable. On using Stata terminology
for maximum clarity see e.g.

http://www.stata.com/statalist/archive/2008-08/msg01258.html

Stata's commands for sampling with replacement fall mostly under the
heading of bootstrapping. However, bootstrap sampling from time
series, as here, is difficult to do without messing up the dependence
structure or invalidating any commands that depend on a prior -tsset-
or -xtset-.

Nick

On Fri, Mar 2, 2012 at 8:25 AM, Osei Kuffour Wiafe <okwiafe@gmail.com> wrote:

> Can anyone help me with a code to take a number of samples from a
> range of vectors? I have two (100x1) vectors of returns on equity and
> bonds over the last 100 years. I'm hoping to withdraw say 1000 samples
> of 50 observation in each, with replacement from each of the vectors
> and save them.(in the same worksheet or elsewhere, not too important
> at this point)!
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index