data("ae");
ae$G3Plus <- 0;
ae$G3Plus[ae$AE_SEV_GD %in% c("3", "4", "5")] <- 1;
ae$Drug_1_Attribution <- 0;
ae$Drug_1_Attribution[ae$CTC_AE_ATTR_SCALE %in% c("Definite", "Probable", "Possible")] <- 1;
ae$Drug_2_Attribution <- 0;
ae$Drug_2_Attribution[ae$CTC_AE_ATTR_SCALE_1 %in% c("Definite", "Probable", "Possible")] <- 1;
prior2RE <- list(R = list(V = diag(1), fix = 1),
G=list(G1=list(V=1, nu=0.02), G2=list(V=1, nu=0.02)));
model1 <- MCMCglmm::MCMCglmm(G3Plus ~ Drug_1_Attribution + Drug_2_Attribution,
random=~Subject + ae_category, family="categorical", data=ae, saveX=TRUE,
verbose=FALSE, burnin=2000, nitt=10000, thin=10, pr=TRUE, prior=prior2RE);
p <- caterpillar_plot(subjID = "Subject",
mcmcglmm_object = model1,
prob = 0.99,
orig_dataset = ae,
binaryOutcomeVar = "G3Plus")
p <- caterpillar_plot(subjID = "ae_category",
mcmcglmm_object = model1,
prob = 0.95,
orig_dataset = ae,
remove.text.subjID = FALSE,
ncol = 4,
binaryOutcomeVar = "G3Plus",
subtitle = "System organ class (n, event)",
title = "Odds Ratio for G3+ Severity with 95% Highest Posterior Density Interval",
fonts = c("Arial", "Arial", "Arial", "Arial"),
break.label.summary = TRUE)
Run the code above in your browser using DataLab