CalAPCEipwRE {aihuman}R Documentation

Compute APCE using frequentist analysis with random effects

Description

Estimate propensity score and use Hajek estimator to compute APCE. See S7 for more details.

Usage

CalAPCEipwRE(data, formula, nAGQ = 1)

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.

formula

A formula 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.

Value

An object of class list with the following elements:

P.D1

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

P.D0

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

APCE

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

P.R

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

alpha

An array with estimated alpha.

delta

An array with estimated delta.

Examples

data(synth)
data(hearingdate_synth)
synth$CourtEvent_HearingDate = hearingdate_synth
freq_apce_re = CalAPCEipwRE(synth, formula = "Y ~ Sex + White + Age + 
                            CurrentViolentOffense + PendingChargeAtTimeOfOffense + 
                            PriorMisdemeanorConviction + PriorFelonyConviction + 
                            PriorViolentConviction + (1|CourtEvent_HearingDate) + D")


[Package aihuman version 0.1.0 Index]