RWilliam
2009-Nov-19 17:00 UTC
[R] How do I specify a partially completed survival analysis model?
Hello, I just started using R to do epidemiologic simulation research using the Cox proportional hazard model. I have 2 covariates X1 and X2 which I want to model as h(t,X)=h0(t)*exp(b1*X1+b2*X2). I assume independence of X from t. After I simulate Time and Censor data vectors denoting the censoring time and status respectively, I can call the following function to fit the data into the Cox model (a is a data.frame containing 4 columns X1, X2, Time and Censor): b = coxph (Surv (Time, Censor) ~ X1 + X2, data = a, method = "breslow"); Now the purpose of me doing simulation is that I have another mechanism to generate the number b2. From the given b2 (say it's 4.3), Cox model can be fit to generate b1 and check how feasible the new model is. Thus, my question is, how do I specify such a model that is partially completed (as in b2 is known). I tried things like Surv(Time,Censor)~X1+4.3*X2, but it's not working. Thanks very much. -- View this message in context: http://old.nabble.com/How-do-I-specify-a-partially-completed-survival-analysis-model--tp26421391p26421391.html Sent from the R help mailing list archive at Nabble.com.
RWilliam
2009-Nov-20 14:46 UTC
[R] How do I specify a partially completed survival analysis model?
Sorry for being impatient but is there really no way of doing this at all? It's quite urgent so any help is very much appreciated. Thank you. RWilliam wrote:> > Hello, > > I just started using R to do epidemiologic simulation research using the > Cox proportional hazard model. I have 2 covariates X1 and X2 which I want > to model as h(t,X)=h0(t)*exp(b1*X1+b2*X2). I assume independence of X from > t. > > After I simulate Time and Censor data vectors denoting the censoring time > and status respectively, I can call the following function to fit the data > into the Cox model (a is a data.frame containing 4 columns X1, X2, Time > and Censor): > b = coxph (Surv (Time, Censor) ~ X1 + X2, data = a, method = "breslow"); > > Now the purpose of me doing simulation is that I have another mechanism to > generate the number b2. From the given b2 (say it's 4.3), Cox model can be > fit to generate b1 and check how feasible the new model is. Thus, my > question is, how do I specify such a model that is partially completed (as > in b2 is known). I tried things like Surv(Time,Censor)~X1+4.3*X2, but it's > not working. Thanks very much. >-- View this message in context: http://old.nabble.com/How-do-I-specify-a-partially-completed-survival-analysis-model--tp26421391p26441878.html Sent from the R help mailing list archive at Nabble.com.