AICC: AICC

Description Usage Arguments Value Examples

View source: R/AICC.R

Description

Compute the AIC for a model

Usage

1
AICC(model, n, p)

Arguments

model

Model to use

n

n value

p

p value

Value

Nothing

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
cholesterol.data <- AdvancedRegression::cholesterol

#creating long-form data set
longform.data <- reshape2::melt(cholesterol.data,
                                id.vars = c("id", "gender", "age"),
                                variable.name = "LDLmonth",
                                value.name = "LDL")

#creating numeric variable for time
month <- ifelse(longform.data$LDLmonth == "LDL0", 0,
                ifelse(longform.data$LDLmonth == "LDL6", 6,
                       ifelse(longform.data$LDLmonth == "LDL9", 9, 24)))

#specifying reference category
gender.rel <- relevel(longform.data$gender, ref = "M")

#fitting random slope and intercept model
fitted.model <- nlme::lme(LDL ~ gender.rel + age + month,
                          random =~ 1 + month|id, data = longform.data)
AICC(fitted.model, n = 108, p = 8)
}

ocrug/AdvancedRegression documentation built on Nov. 4, 2019, 10:13 p.m.