PlotPS {aihuman}R Documentation

Plot the proportion of principal strata (R)

Description

See Figure 3 for example.

Usage

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
)

Arguments

res

A data.frame generated with CalPS.

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 TRUE.

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.

Value

A ggplot.

Examples


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)



[Package aihuman version 0.1.0 Index]