CalPS {aihuman} | R Documentation |
Calculate the proportion of principal strata (R)
Description
Calculate the proportion of each principal stratum (R).
Usage
CalPS(
p.r.mcmc,
name.group = c("Overall", "Female", "Male", "Non-white\nMale", "White\nMale")
)
Arguments
p.r.mcmc |
P.R.mcmc array generated from |
name.group |
A character vector including the labels of five subgroups. |
Value
A data.frame
of the proportion of each principal stratum.
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
)
CalPS(sample_apce[["P.R.mcmc"]])
[Package aihuman version 1.0.1 Index]