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

Re: R: st: Bootstrapping new observations to add to an existing dataset

From   Austin Nichols <>
Subject   Re: R: st: Bootstrapping new observations to add to an existing dataset
Date   Mon, 22 Jun 2009 12:34:43 -0400

Note that the poster said: "I have a dataset which I use for
simulation purposes, to test whether my do-files run correctly."  The
simulations are not to test power using a known DGP or somesuch, with
parameters picked to match an empirical distribution; the simulations
are to test code, possibly for speed improvements or the like.  So I
presume he can simply -expand- to get the appropriately resized
dataset; he need not generate new random data.  The only issue might
be with id variables, or time variables etc., which maybe should get a
new range reflecting the increased size of the dataset, in which case
I can visualize situations where some estimators might fail because of
the replication that created the new dataset--but the poster should
come back to us for more advice if such a situation arises...

On Mon, Jun 22, 2009 at 11:50 AM, Maarten buis <> wrote:
> --- On Mon, 22/6/09, Carlo Lazzaro wrote:
> > you can use -invibeta- for creating random observation with
> > given parameters a and b (in Stata 9.2/SE it goes like
> > this: g A=invibeta(a,b,uniform()) for binary variables.
> This will create a random variable from a continuous
> distribution (the beta distribution) whose values are bound
> between 0 and 1. To create a binary variable you can type:
> -gen A = runiform() < .5-. For more on this see:
> Maarten L. Buis (2007) Stata tip 48: Discrete uses for
> uniform(). The Stata Journal, 7(3):434--435.
> Hope this helps,
> Maarten

*   For searches and help try:

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