[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   Davide Cantoni <>
Subject   Re: R: st: Bootstrapping new observations to add to an existing dataset
Date   Mon, 22 Jun 2009 13:32:14 -0400

Yes, I think that -expand- is probably the best place to start with
for me. My original idea was a little different, in the sense that I
would have left it to chance whether or not the new observations are
identical or not to already existing ones, but ultimately it does not
matter, because, as Austin has pointed out again, the dataset is there
for testing purposes only (it's just a small subsample of a larger
dataset which I cannot see directly, so I need to try out the do-file
on this small dataset first).

Thanks again for all your suggestions, Davide

2009/6/22 Austin Nichols <>:
> 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:
> *
> *
> *

*   For searches and help try:

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