Statalist


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

Re: st: Programming in stata: how to generate a sample following a bivariate distribution


From   "Austin Nichols" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Programming in stata: how to generate a sample following a bivariate distribution
Date   Mon, 27 Aug 2007 13:26:47 -0400

Cecilia <CVIEIRA3@partners.org>:
-help generate- links to -help random_number_functions-
and if you want success coded 0/1 you might try:

clear
set seed 12345
set obs 150
gen success=(uniform()<.1)

On 8/27/07, Vieira, Cecilia <CVIEIRA3@partners.org> wrote:
> Hi all,
> I need to generate a sample from scratch: 150 observations following a binomial
> distribution with p=10% chance of success.
> Which command should I use? Any suggestions about references I could use? I had
> no luck with the stata help.
> Thank you,
> Cecilia
>
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index