CalAPCE {aihuman} | R Documentation |
Calculate APCE
Description
Calculate average principal causal effects (APCE) with ordinal decision. See Section 3.4 for more details.
Usage
CalAPCE(
data,
mcmc.re,
subgroup,
name.group = c("overall", "Sex0", "Sex1", "Sex1 White0", "Sex1 White1"),
rho = 0,
burnin = 0,
out.length = 500,
c0 = 0,
c1 = 0,
ZX = NULL,
save.individual.optimal.decision = FALSE,
parallel = FALSE,
optimal.decision.only = FALSE,
dmf = NULL,
fair.dmf.only = FALSE
)
Arguments
data |
A |
mcmc.re |
A |
subgroup |
A list of numeric vectors for the index of each of the five subgroups. |
name.group |
A list of character vectors for the label of five subgroups. |
rho |
A sensitivity parameter. The default is |
burnin |
A proportion of burnin for the Markov chain. The default is |
out.length |
An integer to specify the progress on the screen. Every |
c0 |
The cost of an outcome. See Section 3.7 for more details. The default is |
c1 |
The cost of an unnecessarily harsh decision. See Section 3.7 for more details. The default is |
ZX |
The data matrix for interaction terms. The default is the interaction between Z and all of the pre-treatment covariates (X). |
save.individual.optimal.decision |
A logical argument specified to save individual optimal decision rules. The default is |
parallel |
A logical argument specifying whether parallel computing is conducted. Do not change this argument manually. |
optimal.decision.only |
A logical argument specified to compute only the optimal decision rule. The default is |
dmf |
A numeric vector of binary DMF recommendations. If |
fair.dmf.only |
A logical argument specified to compute only the fairness of given DMF recommendations. The default is |
Value
An object of class list
with the following elements:
P.D1.mcmc |
An array with dimension n.mcmc by 5 by (k+1) by (k+2) for quantity P(D(1)=d| R=r), dimension 1 is each posterior sample; dimension 2 is subgroup, dimension 3 is (k+1) values of D from 0 to k, dimension 4 is (k+2) values of R from 0 to k+1. |
P.D0.mcmc |
An array with dimension n.mcmc by 5 by (k+1) by (k+2) for quantity P(D(0)=d| R=r). |
APCE.mcmc |
An array with dimension n.mcmc by 5 by (k+1) by (k+2) for quantity P(D(1)=d| R=r)-P(D(0)=d| R=r). |
P.R.mcmc |
An array with dimension n.mcmc by 5 by (k+2) for quantity P(R=r) for r from 0 to (k+1). |
Optimal.Z.mcmc |
An array with dimension n.mcmc by 5 for the proportion of the cases where treatment (PSA provided) is optimal. |
Optimal.D.mcmc |
An array with dimension n.mcmc by 5 by (k+1) for the proportion of optimal decision rule (average over observations). If |
P.DMF.mcmc |
An array with dimension n.mcmc by 5 by (k+1) by (k+2) for the proportion of binary DMF recommendations. Not used in the analysis for the JRSSA paper. |
Utility.g_d.mcmc |
Included if |
Utility.g_dmf.mcmc |
Included if |
Utility.diff.control.mcmc |
Included if |
Utility.diff.treated.mcmc |
Included if |
Examples
data(synth)
sample_mcmc = AiEvalmcmc(data = synth, n.mcmc = 2)
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)