Murray Finkelstein
>
> Good morning.
Geographist comment...
> I would like to perform a sensitivity analysis of some
> regression results. I know the proportion of smokers by
> neighbourhood, but
> I do not have information about individual smoking habits. I wish to
> perform Monte Carlo simulations in which, in each run, I assign each
> individual a dichotomous (0/1) smoking variable based upon
> the probability
> of his being a smoker (as derived from the proportion in his
> neighbourhood). Is there a Stata function that will allow
> me to randomly
> draw 0s or 1s based upon the binomial proportion?
Suppose you have a fraction of smokers .345.
. gen whatever = uniform() < 0.345
returns 1 or 0 with approximately the
correct proportions.
Nick
n.j.cox@durham.ac.uk
*
* 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/