On Sat, Aug 20, 2011 at 7:33 PM, JPF <xpfen...@gmail.com> wrote: > > Göran Broström wrote: >> >> >> Good. Do you still need answers to your other questions? >> >> > > Yes. Could answer the following two questions: > > 1- Can I use phreg function to estimate a model with time-dependent > covariates? In case of a positive answer, how?
Yes. You do it in the way you did it with your first example. No 'id' argument is needed (or allowed) in the call to phreg. The reason is that in PH regression, the hazard function at any time depends only on the covariate value at that time point. In the AFT model, on the other hand, the hazard function at time t depends on all covariate values in the interval (0, t). Therefore aftreg needs the 'id' argument, but phreg does not. > > 2- I could not find any example that clearly explains how to interpret > aftreg output. Specially, refering to the diference between survreg and > aftreg output (intercept and sign of the estimates). I think you already answered that question. You can read more about it in the vignette about parametric models in eha. G. > > I include below an example of output of a regression with coxph, survreg, > phreg and aftreg and a time-independent variable. I would appreciate if you > could explain it or provide an external example that explains how it works. > > n=26 > events=25 > time at risk=45 > > a/ > > coxph(Surv(time,s) ~ Z1, data=data.frame(data)) > > coef exp(coef) se(coef) z p > Z1 0.0249 1.03 0.00907 2.75 0.006 > > > b/ > > phreg(Surv(time,s) ~ Z1, data=data.frame(data), dist="weibull") > > Covariate W.mean Coef Exp(Coef) se(Coef) Wald p > Z1 43.689 0.033 1.033 0.009 0.000 > > log(scale) 0.641 1.899 0.065 0.000 > log(shape) 1.172 3.230 0.158 0.000 > > Max. log. likelihood -22.135 > LR test statistic 13.1 > Degrees of freedom 1 > Overall p-value 0.000302689 > > > c/ > > aftreg(Surv(time,s) ~ Z1, data=data.frame(data), dist="weibull") > > Covariate W.mean Coef Exp(Coef) se(Coef) Wald p > mas 43.689 0.010 1.010 0.002 0.000 > > log(scale) 1.147 3.149 0.141 0.000 > log(shape) 1.172 3.230 0.158 0.000 > > Max. log. likelihood -22.135 > LR test statistic 13.1 > Degrees of freedom 1 > Overall p-value 0.000302692 > > > d/ > > survreg(Surv(time,s) ~ Z1, data=data.frame(data), dist="weibull") > > Value Std. Error z p > (Intercept) 1.1476 0.13498 8.50 1.87e-17 > mas -0.0101 0.00232 -4.34 1.45e-05 > Log(scale) -1.1724 0.15787 -7.43 1.11e-13 > > Scale= 0.310 > > Weibull distribution > Loglik(model)= -22.1 Loglik(intercept only)= -28.7 > Chisq= 13.05 on 1 degrees of freedom, p= 3e-04 > Number of Newton-Raphson Iterations: 5 > > > Thank you very much, > > J > > > > > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/AFT-model-time-dependent-with-weibull-distribution-tp3755079p3757387.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Göran Broström ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.