Statalist


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

AW: Re: st: Creating dataset for survival analysis


From   "fennema@bluewin.ch" <fennema@bluewin.ch>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: Re: st: Creating dataset for survival analysis
Date   Thu, 21 Aug 2008 19:03:34 +0000 (GMT)

Paul, 
VEry helpful. Thank you. 
Peter
----Urspr√ľngliche Nachricht----
Von: epw@mail.med.upenn.edu
Datum: 21.08.2008 13:45
An: <statalist@hsphsun2.harvard.edu>
Betreff: Re: st: Creating dataset for survival analysis

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


fennema@bluewin.ch 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
epw@mail.med.upenn.edu


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




*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index