PlotDIMoutcomes | R Documentation |
See Figure 2 for example.
PlotDIMoutcomes(
res.fta,
res.nca,
res.nvca,
label.position = c("top", "top", "top"),
top.margin = 0.01,
bottom.margin = 0.01,
y.max = 0.2,
label.size = 7,
name.group = c("Overall", "Female", "Male", "Non-white\nMale", "White\nMale")
)
res.fta |
A |
res.nca |
A |
res.nvca |
A |
label.position |
The position of labels. |
top.margin |
Top margin of labels. |
bottom.margin |
Bottom margin of labels. |
y.max |
Maximum value of y-axis. |
label.size |
Size of label. |
name.group |
A character vector including the labels of five subgroups. |
A ggplot.
data(synth)
subgroup_synth <- list(
1:nrow(synth), which(synth$Sex == 0), which(synth$Sex == 1),
which(synth$Sex == 1 & synth$White == 0), which(synth$Sex == 1 & synth$White == 1)
)
synth_fta <- synth_nca <- synth_nvca <- synth
set.seed(123)
synth_fta$Y <- sample(0:1, 1000, replace = TRUE)
synth_nca$Y <- sample(0:1, 1000, replace = TRUE)
synth_nvca$Y <- sample(0:1, 1000, replace = TRUE)
res_fta <- CalDIMsubgroup(synth_fta, subgroup = subgroup_synth)
res_nca <- CalDIMsubgroup(synth_nca, subgroup = subgroup_synth)
res_nvca <- CalDIMsubgroup(synth_nvca, subgroup = subgroup_synth)
PlotDIMoutcomes(res_fta, res_nca, res_nvca)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.