Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: sampling problem


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: sampling problem
Date   Wed, 13 Jun 2007 14:11:57 +0100

The more you want to tie down the counterfactual
sample, the more you will have to tell Stata somehow
or other to produce it. Also, in general, the less likely
it is that it can be produced. For these and other reasons, 
it seems unlikely to me that there even could 
be a canned shortcut, but that's just my fallible intuition. 

On -bsample-: I wouldn't blame -bsample- for what seems 
a reasonable limitation on any sampling command. 
As you say, there are work-arounds. 

I took it from your own mention of -bsample- that it
didn't bite in your circumstances. 

You've left me more fuzzy than before about you really
want to do. 

Nick 
[email protected] 

join allfish (in two separate postings) 
 
> There is a problem with 
> bsample in 
> that it cannot generate more observation than exist. So to take that 
> approach I would have to expand the dataset to ensure that I 
> had enough 
> observations to fit in with my desired data set.
 
> Thanks for this suggestion - I did think of doing this. The 
> problem is I 
> have other variables, which are far more complicated and have 
> many more 
> values, which I want to use for the counterfactuals as well. 
> I was hoping 
> that there may be a program which could help - or at least 
> some short cut I could use.
 
Nick Cox

> >Focusing on this (typos corrected)
> >
> >I want to draw individuals from 2007 according to the distribution
> >of health in 1985 so I draw individuals
> >with health=1 with prob=0.4,
> >health=2 with prob=0,
> >health=4 with prob=0.1
> >and health=5 with prob=0.5
> >(where the probabilities come from the health1985 distribution).
> >
> >you can work out from your desired sample size the subsample
> >sizes you desire. Suppose you want a sample of 1000
> >
> >use mydata
> >bsample 400 if health == 1
> >save cfsample
> >
> >use mydata, clear
> >bsample 100 if health == 4
> >append using cfsample
> >
> >use mydata, clear
> >bsample 500 if health == 5
> >append using cfsample
> >
> >I would be happy to learn of a smarter solution. Naturally
> >you need do nothing about outcomes not to be included
> >in your sample. I can't comment on the status of samples
> >like this. Bootstrap experts may be able to help further.

*
*   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