|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: creating survival dataset
Hello,
I'm creating survival data, and puzzled by two observations here,
which probably reflect my elementary knowledge of the subject.
Perhaps someone can offer some helpful advice.
1. Why it doesn't matter what I specify for lambda?
2. Why the confounder variable "w" is dropped due to collinearity?
clear
set mem 4m
set obs 10000 //create 10,000 observations
gen id=_n //Create ID numbers
set seed 12358 //set random number seed for reproducibility
gen a=0 + int(2*uniform()) //Generate treatment:
discrete 0/1 uniform random vars
gen age=30 + int(40*uniform()) // create random age variable,
ranging from 30-70
gen w=(1/(1+exp(-(-1.74+a)))) // create confounder, which is
related to treatment
gen lambda=-2 // create lambda
gen t=ln(uniform())/(lambda*exp(-0.8*a)) // using Bender, 2005, to
specify Beta for tx
stset t
stcox a age w, nohr // w dropped due to collinearity
sts graph, by(a)
Thank you kindly.
--
Best wishes,
Michael McCulloch
Pine Street Foundation
124 Pine St., San Anselmo, CA 94960-2674
Tel: (415) 407-1357
Fax: (415) 485-1065
[email protected]
www.pinestreetfoundation.org
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/