BootstrapAPCEipwREparallel: Bootstrap for estimating variance of APCE with random effects

View source: R/frequentist_re.R

BootstrapAPCEipwREparallelR Documentation

Bootstrap for estimating variance of APCE with random effects

Description

Estimate variance of APCE for frequentist analysis with random effects using bootstrap. See S7 for more details.

Usage

BootstrapAPCEipwREparallel(data, rep = 1000, fixed, random, nAGQ = 1, size = 5)

Arguments

data

A data.frame or matrix of which columns consists of pre-treatment covariates, a binary treatment (Z), an ordinal decision (D), and an outcome variable (Y). The column names of the latter three should be specified as "Z", "D", and "Y" respectively.

rep

Size of bootstrap

fixed

A formula for the fixed-effects part of the model to fit.

random

A formula for the random-effects part of the model to fit.

nAGQ

Integer scalar - the number of points per axis for evaluating the adaptive Gauss-Hermite approximation to the log-likelihood. Defaults to 1, corresponding to the Laplace approximation.

size

The number of parallel computing. The default is 5.

Value

An object of class list with the following elements:

P.D1.boot

An array with dimension rep by (k+1) by (k+2) for quantity P(D(1)=d| R=r), dimension 1 is rep (size of bootstrap), dimension 2 is (k+1) values of D from 0 to k, dimension 3 is (k+2) values of R from 0 to k+1.

P.D0.boot

An array with dimension rep by (k+1) by (k+2) for quantity P(D(0)=d| R=r).

APCE.boot

An array with dimension rep by (k+1) by (k+2) for quantity P(D(1)=d| R=r)-P(D(0)=d| R=r).

P.R.boot

An array with dimension rep by (k+2) for quantity P(R=r) for r from 0 to (k+1).

References

Imai, K., Jiang, Z., Greiner, D.J., Halen, R., and Shin, S. (2023). "Experimental evaluation of algorithm-assisted human decision-making: application to pretrial public safety assessment." Journal of the Royal Statistical Society: Series A. <DOI:10.1093/jrsssa/qnad010>.

Examples


data(synth)
data(hearingdate_synth)
synth$CourtEvent_HearingDate <- hearingdate_synth
set.seed(123)
boot_apce_re <- BootstrapAPCEipwREparallel(synth,
  fixed = "Y ~ Sex + White + Age +
                   CurrentViolentOffense + PendingChargeAtTimeOfOffense +
                   PriorMisdemeanorConviction + PriorFelonyConviction +
                   PriorViolentConviction + D",
  random = "~ 1|CourtEvent_HearingDate",
  size = 1
) # adjust the size



aihuman documentation built on April 12, 2025, 1:47 a.m.