On Tue, 12 Dec 2006, [EMAIL PROTECTED] wrote:

> I have a case-control study that I'm analysing using the conditional
> logistic regression function clogit from the survival package.
>
> I would like to calculate the AICc of the models I fit using clogit.
>
> I have a variety of scripts that can calculate AICc for models with a
> logLik method, but clogit does not appear to use this method.
>
> Is there a way I can calculate AICc from clogit in R?

Review

        ?logLik
        ?coxph.object

and then roll your own logLik.coxph.

Here is one version:

logLik.coxph <-
     function(object,...) {
         y <-  -1 * (object$loglik[1] - object$loglik[2])
         class(y) <- "logLik"
         attr(y,'df')<- sum(!is.na(object$coef))
         y
}

Try it like this:
> fit <- clogit(case ~ spontaneous + induced + strata(stratum), data = 
infert)
> logLik(fit)
'log Lik.' 26.57712 (df=2)
>

[...]

Charles C. Berry                        (858) 534-2098
                                          Dept of Family/Preventive Medicine
E mailto:[EMAIL PROTECTED]               UC San Diego
http://biostat.ucsd.edu/~cberry/         La Jolla, San Diego 92093-0717

______________________________________________
[email protected] 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.

Reply via email to