Statalist The Stata Listserver

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

Re: st: random numbers generator

From   "Cassio M. Turra" <>
Subject   Re: st: random numbers generator
Date   Sun, 6 May 2007 18:48:51 -0300

Dear Brendan and Maarten
thanks for your help and sorry for not being very specific.

I will give you and example of what I'm trying to do.
I need to input age of death for individuals between single years of age.
Let's suppose that for the ages 20 to 25, I have the following
distribution of ages of death among those who die (these are not real

20 0.40
21 0.20
22 0.15
23 0.20
24 0.05

I need to draw random numbers based on this distribution.

any more specific help?

Thanks a lot. Cassio

On 5/6/07, Maarten buis <> wrote:
--- "Cassio M. Turra" <> wrote:
> Hi, I need to generate random numbers from a discrete probability
> distribution (drawn from a life table). Does anyone know how I can do
> it in Stata?

You are not very specific, so it is hard to give a specific answer.
This post
gives a general description on how to draw from a dichotomous
distribution and is easily generalized to other discrete distributions.

Hope this helps,

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship.*
*   For searches and help try:

*   For searches and help try:

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