# NOT RUN {
# Import data for partial association analysis
data("ANES2016")
ANES2016$PreVote.num <- as.factor(ANES2016$PreVote.num)
PAsso_3v <- PAsso(responses = c("PreVote.num", "PID", "selfLR"),
adjustments = c("income.num", "age", "edu.year"),
data = ANES2016, uni.model = "probit",
method = c("kendall"),
resids.type = "surrogate", jitter = "latent")
diag_p1 <- diagnostic.plot(object = PAsso_3v, output = "qq")
diag_p2 <- diagnostic.plot(object = PAsso_3v, output = "fitted")
diag_p3 <- diagnostic.plot(object = PAsso_3v, output = "covariate")
# Simply diagnose a model
# Fit cumulative link models
fit1 <- ordinal::clm(PreVote.num ~ income.num + age + edu.year, data = ANES2016, link = "logit")
# diagnostic.plot
plot_qq_1 <- diagnostic.plot(object = fit1, output = "qq")
plot_fit_1 <- diagnostic.plot(object = fit1, output = "fitted")
plot_cov_1 <- diagnostic.plot(object = fit1, output = "covariate")
# }
Run the code above in your browser using DataLab