# load package
library("APCI")
# load data
test_data <- APCI::women9017
test_data$acc <- as.factor(test_data$acc)
test_data$pcc <- as.factor(test_data$pcc)
test_data$educc <- as.factor(test_data$educc)
test_data$educr <- as.factor(test_data$educr)
# fit APC-I model
APC_I <- APCI::apci(outcome = "inlfc",
age = "acc",
period = "pcc",
cohort = "ccc",
weight = "wt",
data = test_data,dev.test=FALSE,
print = TRUE,
family = "gaussian")
summary(APC_I)
## plot the raw pattern
apci.plot(data = test_data, outcome_var = "inlfc", age = "acc",model=APC_I,
period = "pcc", type = "explore")
## plot the model results
apci.plot(data = test_data, outcome_var = "inlfc", age = "acc",model=APC_I,
period = "pcc", type = "model")
Run the code above in your browser using DataLab