Description Usage Arguments Value Examples
Compute the AIC for a model
1 | AICC(model, n, p)
|
model |
Model to use |
n |
n value |
p |
p value |
Nothing
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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.