View source: R/plot_principal.R
PlotPS | R Documentation |
See Figure 3 for example.
PlotPS(
res,
y.min = 0,
y.max = 0.75,
col.values = c("blue", "black", "red", "brown"),
label = TRUE,
r.labels = c("safe", " easily \n preventable ",
"\n preventable\n", " risky"),
label.position = c("top", "top", "top", "bottom"),
top.margin = 0.02,
bottom.margin = 0.02,
label.size = 6.5
)
res |
A |
y.min |
Minimum value of y-axis. |
y.max |
Maximum value of y-axis. |
col.values |
Color of point for each principal stratum. |
label |
A logical argument whether to specify label of each principal stratum. The default is |
r.labels |
Label of each principal stratum. |
label.position |
The position of labels. |
top.margin |
Top margin of labels. |
bottom.margin |
Bottom margin of labels. |
label.size |
Size of label. |
A ggplot.
data(synth)
sample_mcmc <- AiEvalmcmc(data = synth, n.mcmc = 10)
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)
)
sample_apce <- CalAPCE(
data = synth, mcmc.re = sample_mcmc,
subgroup = subgroup_synth
)
sample_ps <- CalPS(sample_apce[["P.R.mcmc"]])
PlotPS(sample_ps, col.values = c("blue", "black", "red", "brown", "purple"), label = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.