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

st: creating survival dataset

From   Michael McCulloch <>
To   Statalist <>
Subject   st: creating survival dataset
Date   Fri, 30 May 2008 14:42:08 -0700

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?

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
* For searches and help try:

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