Paul,
VEry helpful. Thank you.
Peter
----Ursprüngliche Nachricht----
Von: [email protected]
Datum: 21.08.2008 13:45
An: <[email protected]>
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
[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/
*
* 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/