# 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 heatmap
apci.plot.heatmap(model=APC_I,age="acc",period="pcc",first_age = 20,
first_period = 1940, interval = 5)
Run the code above in your browser using DataLab