Re: [R] Problems with coxph and survfit in a stratified model with interactions

2012-10-17 Thread rm
Hi Chris, Yes, that is exactly the model I want to fit, i.e. a separate 'baseline' hazard for each stratum (defined by cov1) and a coefficient for cov2 that is different for each stratum. Is suspect that there is a problem with the following line of your code. sCox <- coxph(Surv(time, status)

Re: [R] Problems with coxph and survfit in a stratified model with interactions

2012-10-16 Thread Andrews, Chris
, women, method 2 lines(sfCoxw0, lty=2, lwd=3, mark.time=FALSE, col=1) lines(sfCoxw1, lty=2, lwd=3, mark.time=FALSE, col=2) lines(sfCoxw2, lty=2, lwd=3, mark.time=FALSE, col=3) lines(sfCoxw3, lty=2, lwd=3, mark.time=FALSE, col=4) -Original Message- From: rm [mailto:r...@wippies.se] Sent: Monday,

Re: [R] Problems with coxph and survfit in a stratified model with interactions

2012-10-15 Thread Chris Andrews
rm wrote > I’m trying to set up proportional hazard model that is stratified with > respect to covariate 1 and has an interaction between covariate 1 and > another variable, covariate 2. Both variables are categorical. In the > following, I try to illustrate the two problems that I’ve encountered,

Re: [R] Problems with coxph and survfit in a stratified model with interactions

2012-10-15 Thread Terry Therneau
Your df object (newdata) has to have ALL the variables in it. Normally you wouldn't need the strata variable, but in this case cov1 is also a covariate. Look at the example I gave earlier. Terry T. On 10/15/2012 05:00 AM, r-help-requ...@r-project.org wrote: Many thanks for your very quick r

Re: [R] Problems with coxph and survfit in a stratified model, with interactions

2012-10-14 Thread Terry Therneau
First, here is your message as it appears on R-help. On 10/14/2012 05:00 AM, r-help-requ...@r-project.org wrote: > I?m trying to set up proportional hazard model that is stratified with > respect to covariate 1 and has an interaction between covariate 1 and > another variable, covariate 2. Both va

[R] Problems with coxph and survfit in a stratified model with interactions

2012-10-13 Thread rm
I’m trying to set up proportional hazard model that is stratified with respect to covariate 1 and has an interaction between covariate 1 and another variable, covariate 2. Both variables are categorical. In the following, I try to illustrate the two problems that I’ve encountered, using the lung da

[R] Problems with coxph and survfit in a stratified model with interactions

2012-10-13 Thread rm
I’m trying to set up proportional hazard model that is stratified with respect to covariate 1 and has an interaction between covariate 1 and another variable, covariate 2. Both variables are categorical. In the following, I try to illustrate the two problems that I’ve encountered, using the lung da