Immanuel

2010-Nov-25 16:50 UTC

### [R] aftreg vs survreg loglogistic aft model (different intercept term)

Hi, I'm estimating a loglogistic aft (accelerated failure time) model, just a simple plain vanilla one (without time dependent covariates), I'm comparing the results that I obtain between aftreg (eha package) and survreg(surv package). If I don't use any covariate the results are identical , if I add covariates all the coefficients are the same until a precision of 10^4 or 10^-5 except for the intercept term(in survreg)=log(scale) (in aftreg) that are similar but with a worse precision of 10^-1 or 10^-2. Any idea of why this happens? Probably the different covariates coefficients have a so big influence on the intercept term? Thank you Immanuel -- View this message in context: http://r.789695.n4.nabble.com/aftreg-vs-survreg-loglogistic-aft-model-different-intercept-term-tp3059250p3059250.html Sent from the R help mailing list archive at Nabble.com.

Immanuel

2010-Nov-26 16:17 UTC

### [R] aftreg vs survreg loglogistic aft model (different intercept term)

I add an example , all the variables are mutually excluding dummy variables, notice the different intercept: 5.627 vs 5.545: survreg: Value Std. Error z p (Intercept) 5.627 0.00887 634.3 0.00e+00 Var1.recR2 -0.108 0.01026 -10.5 1.00e-25 Var1.recR3 -0.490 0.01099 -44.5 0.00e+00 Var1.recR4 -0.542 0.01303 -41.6 0.00e+00 Var1.recR5 -0.891 0.01095 -81.3 0.00e+00 Log(scale) -0.324 0.00350 -92.7 0.00e+00 Scale= 0.723 Log logistic distribution Loglik(model)= -379503.5 Loglik(intercept only)= -383388.9 Chisq= 7770.76 on 4 degrees of freedom, p= 0 aftreg: Covariate W.mean Coef Exp(Coef) se(Coef) Wald p Var1.recR 1 0.253 0 1 (reference) 2 0.330 0.108 1.114 0.010 0.000 3 0.191 0.490 1.632 0.011 0.000 4 0.106 0.542 1.720 0.013 0.000 5 0.120 0.891 2.437 0.011 0.000 log(scale) 5.545 256.029 0.008 0.000 log(shape) 0.324 1.383 0.003 0.000 Max. log. likelihood -379504 -- View this message in context: http://r.789695.n4.nabble.com/aftreg-vs-survreg-loglogistic-aft-model-different-intercept-term-tp3059250p3060545.html Sent from the R help mailing list archive at Nabble.com.

Terry Therneau

2010-Nov-29 13:35 UTC

### [R] aftreg vs survreg loglogistic aft model (different intercept term)

Survreg maximizes the log-likelihood to a relative tolerance of 1e-9 (?survreg.control). The printout shows -379503.5, to see the rest of the digits you need something like: fit <- survreg(.... print(fit$loglik, digits=9) Aftreg printed even less digits; you would have to do the same with it to see which routine got closer to maximizing the actual log-likelihood. That is of survreg showed -37903.5392 and aftreg -37903.6123 then survreg "wins". Likley all this means is that the default iteration tolerance is smaller for one routine than for the other. When you consider that "significant" changes in a log-likihood are on the order of 3.94/2 =2 units, I do not get very excited by a .08 difference in convergence. Terry Therneau ---------- begin included message -------------- I add an example , all the variables are mutually excluding dummy variables, notice the different intercept: 5.627 vs 5.545: survreg: Value Std. Error z p (Intercept) 5.627 0.00887 634.3 0.00e+00 Var1.recR2 -0.108 0.01026 -10.5 1.00e-25 Var1.recR3 -0.490 0.01099 -44.5 0.00e+00 Var1.recR4 -0.542 0.01303 -41.6 0.00e+00 Var1.recR5 -0.891 0.01095 -81.3 0.00e+00 Log(scale) -0.324 0.00350 -92.7 0.00e+00 Scale= 0.723 Log logistic distribution Loglik(model)= -379503.5 Loglik(intercept only)= -383388.9 Chisq= 7770.76 on 4 degrees of freedom, p= 0 aftreg: Covariate W.mean Coef Exp(Coef) se(Coef) Wald p Var1.recR 1 0.253 0 1 (reference) 2 0.330 0.108 1.114 0.010 0.000 3 0.191 0.490 1.632 0.011 0.000 4 0.106 0.542 1.720 0.013 0.000 5 0.120 0.891 2.437 0.011 0.000 log(scale) 5.545 256.029 0.008 0.000 log(shape) 0.324 1.383 0.003 0.000 Max. log. likelihood -379504 -------- end inclusion -----------