% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wdsmatchATT.R
\name{wdsmatchATT}
\alias{wdsmatchATT}
\title{Weighted Double Score Matching Estimator for Population Average Treatment Effect on the Treated}
\usage{
wdsmatchATT(
  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
)
}
\arguments{
\item{Y}{Numeric vector of observed outcomes.}

\item{X}{Numeric matrix or data frame of covariates.}

\item{Z}{Binary treatment assignment indicator (1 = treated, 0 = control).}

\item{weights}{Numeric vector of survey design weights. Required.}

\item{M}{Number of nearest neighbors for matching (default 5).}

\item{ps}{Numeric vector of pre-estimated propensity scores. If
\code{NULL} (default), estimated internally using \code{model.ps}.}

\item{pg}{Numeric matrix of pre-estimated prognostic scores with columns
\code{psi0} (control) and \code{psi1} (treated). If \code{NULL}
(default), estimated internally using \code{model.pg}.}

\item{model.ps}{Formula for propensity score model (e.g.,
\code{Z ~ X1 + X2}). If \code{NULL}, uses all columns of \code{X}.}

\item{model.pg}{Formula for prognostic score model (e.g.,
\code{Y ~ X1 + X2}). If \code{NULL}, uses all columns of \code{X}.}

\item{sampling}{Character: \code{"retrospective"} (default) for
treatment-dependent sampling (survey-weighted PS estimation), or
\code{"prospective"} for treatment-independent sampling
(unweighted PS estimation).}

\item{use.bias.correction}{Logical: apply polynomial sieve bias correction
(default \code{TRUE}).}

\item{varest}{Logical: compute bootstrap variance estimate and confidence
interval (default \code{TRUE}).}

\item{boots}{Number of multinomial bootstrap replicates (default 200).}

\item{alpha}{Significance level for confidence intervals (default 0.05).}
}
\value{
A list with components:
  \item{estimate}{Point estimate of PATT.}
  \item{se}{Bootstrap standard error (if \code{varest = TRUE}).}
  \item{ci}{Confidence interval as \code{c(lower, upper)}
    (if \code{varest = TRUE}).}
  \item{boot.estimates}{Vector of bootstrap replicate estimates
    (if \code{varest = TRUE}).}
  \item{M}{Number of matches used.}
  \item{n}{Sample size.}
  \item{n.treated}{Number of treated units.}
  \item{n.control}{Number of control units.}
  \item{call}{The matched call.}
}
\description{
Estimates the population average treatment effect on the treated (PATT)
using weighted double score matching (WDSM) with survey design weights.
Performs one-sided matching from treated to control units on the
control-side double score D_0(X) = (e(X), Psi_0(X)). Only the
counterfactual control outcome Y(0) needs imputation; treated outcomes
are directly observed. Aggregation uses Hajek normalization over
treated-side survey weights. Polynomial sieve bias correction and
linearization-based multinomial bootstrap with survey-weighted reuse
frequencies are applied. PATT requires only one-sided
unconfoundedness: Y(0) independent of Z given X.
}
\examples{
data(survey_obs)
fit <- wdsmatchATT(
  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

}
