Statalist


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

Re: st: Creating dataset for survival analysis


From   "E. Paul Wileyto" <[email protected]>
To   [email protected]
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

t=(-ln(R)/H)^(1/p)

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


[email protected] 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,
Peter
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/

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

215-746-7147
Fax: 215-746-7140
[email protected]


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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