Learn R Programming

WMAP (version 1.1.0)

causal.estimate: Estimate causal effects using FLEXOR or other methods

Description

This function estimates causal effects based on the specified pseudo-population method. The FLEXOR method involves an iterative two-step procedure.

Usage

causal.estimate(
  S,
  Z,
  X,
  Y,
  B = 100,
  method,
  naturalGroupProp = NULL,
  num.random = 40,
  gammaMin = 0.001,
  gammaMax = (1 - 0.001),
  seed = NULL,
  verbose = TRUE
)

Value

An S3 list object with the following components:

percentESS

Percentage sample effective sample size (ESS) of the pseudo-population.

moments.ar

An array of dimension \(3 \times K \times L\), containing:

  • Estimated means, standard deviations (SDs), and medians (dimension 1),

  • For \(K\) groups (dimension 2),

  • And \(L\) counterfactual outcomes (dimension 3).

otherFeatures.v

Estimated mean group differences for \(L\) outcomes.

collatedMoments.ar

An array of dimension \(3 \times K \times L \times B\), containing:

  • moments.ar of the \(b\)th bootstrap sample (dimensions 1–3),

  • For \(B\) bootstrap samples (dimension 4).

collatedOtherFeatures.mt

A matrix of dimension \(L \times B\) containing:

  • otherFeatures.v of the \(b\)th bootstrap sample (dimension 1),

  • For \(B\) bootstrap samples (dimension 2).

collatedESS

A vector of length \(B\)

containing percentage sample ESS for B bootstrap samples.
method

Pseudo-population method, i.e., weighting method.

Arguments

S

Vector of factor levels representing the study memberships. Takes values in {1, ..., J}.

Z

Vector of factor levels representing the group memberships. Takes values in {1, ..., K}.

X

Covariate matrix of \(N\) rows and \(p\) columns.

Y

Matrix of \(L\) outcomes, with dimensions \(N \times L\).

B

Number of bootstrap samples for variance estimation. Default is 100.

method

Pseudo-population method, i.e., weighting method. Take values in FLEXOR, IC, or IGO.

naturalGroupProp

Relevant only for FLEXOR method: a fixed user-specified probability vector \(\theta\).

num.random

Relevant only for FLEXOR method: number of random starting points of \(\gamma\) in the two-step iterative procedure. Default is 40.

gammaMin

Relevant only for FLEXOR method: Lower bound for each \(\gamma_s\) in the two-step iterative procedure. Default is 0.001.

gammaMax

Relevant only for FLEXOR method: Upper bound for each \(\gamma_s\) in the two-step iterative procedure. Default is 0.999.

seed

Seed for random number generation. Default is NULL.

verbose

Logical; if TRUE (default), displays progress messages during computation to the console. Set to FALSE to suppress these messages.

Examples

Run this code
data(demo)
set.seed(1)
causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp)

Run the code above in your browser using DataLab