Learn R Programming

survstan (version 0.0.7.1)

extractAIC.survstan: Extract AIC from a Fitted Model

Description

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

Usage

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

Value

the ANOVA table.

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.

Examples

Run this code
# \donttest{
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)
# }

Run the code above in your browser using DataLab