1
$\begingroup$

I am fitting a model using survreg and then I got the following result:

    Scale= 1.165371 

Loglik(model)= -4117.3   Loglik(intercept only)= -4162.5
    Chisq= 90.53 on 10 degrees of freedom, p= 4.2e-15 
n= 1000 

Now I want to get the p (4.2e-15) and used the following code:

signif(1 - pchisq(summary(srFit)$chi,  summary(srFit)$df), 2)

and the result is 3.9e-14. I think I'm calculating p correctly but not sure why the values is different.

$\endgroup$
  • $\begingroup$ That's a bit odd...but reproducing this agrees with survreg's results: try 1 - pchisq(90.53, df = 10) $\endgroup$ – Cliff AB Oct 16 '15 at 22:20
  • $\begingroup$ Thanks, it gives me 4.218847e-15 which is very close, but why did you choose df =10? $\endgroup$ – Erin Oct 16 '15 at 23:01
  • $\begingroup$ the output from servreg indicates 10 degrees of freedom (i.e. 10 regression parameters, other than the intercept). $\endgroup$ – Cliff AB Oct 16 '15 at 23:56
  • $\begingroup$ True, but when I get srFit$df, it gives me 12, I don't know why? $\endgroup$ – Erin Oct 17 '15 at 0:03
  • $\begingroup$ Ah, probably because there are also two baseline parameters in most survreg parameterizations (only 1 for exponential distribution). So there's a total of 12 parameters in your model, but given your baseline distribution (probably weibull?), you will always fit at least 2. That is why the output says 10 degrees of freedom: its comparing no regression parameters (but 2 baseline) with all 10 regression parameters (+2 baseline) $\endgroup$ – Cliff AB Oct 17 '15 at 0:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.