causal.estimate {WMAP} | R Documentation |
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
)
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 |
Y |
Matrix of |
B |
Number of bootstrap samples for variance estimation. Default is 100. |
method |
Pseudo-population method, i.e., weighting method. Take values in |
naturalGroupProp |
Relevant only for FLEXOR method: a fixed user-specified probability vector |
num.random |
Relevant only for FLEXOR method: number of random starting points of |
gammaMin |
Relevant only for FLEXOR method: Lower bound for each |
gammaMax |
Relevant only for FLEXOR method: Upper bound for each |
seed |
Seed for random number generation. Default is |
verbose |
Logical; if |
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 theb
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 theb
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.
Examples
data(demo)
set.seed(1)
causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp)