extractAIC.survstan function

Extract AIC from a Fitted Model

Extract AIC from a Fitted Model

Computes the (generalized) Akaike An Information Criterion for a fitted parametric model.

## S3 method for class 'survstan' extractAIC(fit, scale, k = 2, ...)

Arguments

  • fit: a fitted model of the class survstan
  • scale: optional numeric specifying the scale parameter of the model. Currently only used in the "lm" method, where scale specifies the estimate of the error variance, and scale = 0 indicates that it is to be estimated by maximum likelihood.
  • k: numeric specifying the ‘weight’ of the equivalent degrees of freedom part in the AIC formula.
  • ...: further arguments passed to or from other methods.

Returns

the ANOVA table.

Examples

library(survstan) fit1 <- aftreg(Surv(futime, fustat) ~ 1, data = ovarian, baseline = "weibull", init = 0) fit2 <- aftreg(Surv(futime, fustat) ~ rx, data = ovarian, baseline = "weibull", init = 0) fit3 <- aftreg(Surv(futime, fustat) ~ ecog.ps + rx, data = ovarian, baseline = "weibull", init = 0) extractAIC(fit1) extractAIC(fit2) extractAIC(fit3)