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

Re: st: Creating dataset for survival analysis

From   "E. Paul Wileyto" <>
Subject   Re: st: Creating dataset for survival analysis
Date   Thu, 21 Aug 2008 07:45:06 -0400

When you say two competing events, do you mean competing risks, that subjects are at risk for both events concurrently?

May not matter, there's an easy solution..

Use the Weibull distribution:

Surv=exp(-H t^p)

Draw random times from the Weibull by substituting a uniform random variate (R) for Surv, and solving for t


If you give each "subject" an ID number, you can use stset and stsplit to do your censoring.

For a fixed hazard ratio based on a discrete covariate, use different values of H.

For competing risks, draw two separate times, one for each event, and take the shorter one.

Paul wrote:

I am interested to perform some simulations with survival analysis (KM). Does anybody now how to Stata to create a
dataset with a large number of subjects with a constant hazard rate for two competing events? Thank you in advance,
* For searches and help try:

E. Paul Wileyto, Ph.D.
Assistant Professor of Biostatistics
Tobacco Use Research Center
School of Medicine, U. of Pennsylvania
3535 Market Street, Suite 4100
Philadelphia, PA  19104-3309

Fax: 215-746-7140

*   For searches and help try:

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