| wdsmatchATE | R Documentation |
Estimates the population average treatment effect (PATE) using weighted double score matching with survey design weights. Matching uses propensity probabilities and arm-specific prognostic scores. Missing potential outcomes are imputed by survey-weighted averaging within match sets and aggregated using Hajek normalization. Optional polynomial bias correction adjusts for matching discrepancies. Inference uses fixed-reuse multinomial replication with centered normal Wald intervals.
wdsmatchATE(
Y,
X,
Z,
weights,
M = 5,
ps = NULL,
pg = NULL,
model.ps = NULL,
model.pg = NULL,
sampling = c("retrospective", "prospective"),
use.bias.correction = TRUE,
varest = TRUE,
boots = 200,
alpha = 0.05
)
Y |
Finite numeric vector of observed outcomes, with no missing values. |
X |
Numeric matrix or data frame with finite numeric covariate columns,
one row per unit, and unique names other than |
Z |
Binary treatment indicator (1 = treated, 0 = control), with one entry per unit and both groups represented. |
weights |
Finite, strictly positive numeric vector of survey design weights, with one entry per unit. Required. |
M |
Positive integer number of nearest neighbors (default 5). Each
required donor arm must contain at least |
ps |
Optional finite numeric vector of pre-estimated propensity
probabilities strictly between zero and one. If |
pg |
Optional matrix of pre-estimated prognostic scores, with columns
|
model.ps |
Formula for the propensity model, such as
|
model.pg |
Formula for the prognostic regression, such as
|
sampling |
Character: |
use.bias.correction |
Logical: apply the arm-specific complete
quadratic bias correction (default |
varest |
Logical: compute replication variance and a centered normal
Wald interval (default |
boots |
Integer number of multinomial replicates, at least 2 when variance is requested (default 200). |
alpha |
Significance level strictly between zero and one (default
0.05). The interval confidence level is |
Under retrospective sampling, the propensity score is fitted with survey weights; under prospective sampling it is fitted without survey weights. Prognostic regressions are unweighted within each treatment arm in both designs. These modeling choices require the corresponding identification and sampling assumptions; weighting alone does not establish those assumptions.
Matching uses unweighted pooled standardization of propensity probabilities and the relevant prognostic score. The bias-correction regression uses survey weights and a complete quadratic basis in that arm's own double score: an intercept, both coordinates, their squares, and their interaction. Distances are Euclidean, matching is with replacement, and distance ties are resolved by the original donor row order. Propensity fitting starts from zero coefficients and checks convergence and finite, nonsaturated fitted probabilities.
Multinomial replication draws counts for the original sample units and keeps the original match sets and weighted reuse coefficients fixed. With bias correction enabled, internally estimated nuisance scores are refitted using the counts, with additional survey weighting for retrospective propensity fitting and outcome bias correction. Supplied scores remain fixed. Thus, when scores are supplied, the resulting inference is conditional on them and excludes uncertainty from their external estimation. The corresponding model formula is not used to replace a supplied score during replication.
With B = boots successful replicates, the variance estimate is
mean((boot.estimates - mean(boot.estimates))^2), using divisor B.
The interval is estimate + c(-1, 1) * qnorm(1 - alpha/2) * se.
All requested replicates must succeed. An invalid fit, degenerate score,
unsuccessful replicate, or nonfinite calculation raises an error; failed
draws are not omitted or replaced by zeros. A successful numerical check
does not establish adequate statistical overlap.
With use.bias.correction = FALSE, point estimation uses direct
matched imputation without polynomial outcome adjustment, and replication
uses the fixed-reuse expression without a bias-correction regression.
Unused nuisance scores are not refitted for these raw fixed-match replicates.
Matching discrepancies remain, so the asymptotic justification for the
bias-corrected estimator does not automatically apply to this option.
Double robustness concerns consistency under the stated identification, sampling, positivity, and regularity assumptions when a required score model is correctly specified; it does not guarantee negligible finite-sample bias or nominal interval coverage in every setting. This interface accepts unit-level weights, not survey strata, clusters, or design-specific replicate weights. The individual-unit multinomial procedure is not a general variance estimator for arbitrary complex survey designs.
A list of class wdsmatch with components:
estimate |
Point estimate of PATE. |
variance |
Replication variance with divisor B, or |
se |
Replication standard error, or |
ci |
Centered normal Wald interval as |
boot.estimates |
All requested finite replication estimates, or
|
alpha |
Requested significance level. |
interval.type |
Interval-construction metadata. |
variance.divisor |
Replication-variance divisor metadata. |
n.boot |
Number of retained replicates. |
estimand |
Target estimand. |
sampling |
Sampling-design option. |
settings |
Estimation and replication settings. |
M |
Number of matches used. |
n |
Sample size. |
n.treated |
Number of treated units. |
n.control |
Number of control units. |
call |
The matched call. |
diagnostics |
Point-representation agreement and numerical propensity-fit diagnostics for the point estimate and replicates. |
data(survey_obs)
fit <- wdsmatchATE(
Y = survey_obs$Y,
X = survey_obs[, c("X1", "X2", "X3", "X4", "X5", "X6")],
Z = survey_obs$Z,
weights = survey_obs$survey_weight,
M = 3,
model.ps = Z ~ X1 + X2 + X3 + X4 + X5 + X6 + X1:X2,
model.pg = Y ~ X1 + X2 + X3 + X4 + X5 + X6 + X1:X2,
sampling = "retrospective",
varest = FALSE
)
fit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.