View source: R/build.dist.struct.R
build.dist.struct | R Documentation |
This function computes rank-based Mahalanobis distances between treated and control units and returns an object suitable for use in the distance.structure argument of rcbalance.
build.dist.struct(z, X, exact = NULL, calip.option = "propensity", calip.cov = NULL, caliper = 0.2, verbose = FALSE)
z |
a vector of treatment and control indicators, 1 for treatment and 0 for control. |
X |
a data frame or a numeric or logical matrix containing covariate information for treated and control units. Its row count must be equal to the length of |
exact |
an optional vector of the same length as |
calip.option |
one of |
calip.cov |
see |
caliper |
gives the size of the caliper when the user specifies the |
verbose |
if |
If X
is a data frame and contains any character variables they are converted to factors with a warning. If there are missing values in factor columns of X
, they are treated as a new factor level. If there are missing values in numeric or logical columns of X
, an indicator of missingness for that column is added to X
and the missing values are imputed with the column mean. This follows the recommendations of Rosenbaum (Design of Observational Studies section 9.4, 2010).
A distance.structure object, the form of which is described in the documentation for the distance.structure
argument of rcbalance
. Treated and control indices are numbered 1:nt
and 1:nc
respectively based on the order in which they appear in the z
vector.
Samuel D. Pimentel
rcbalance
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.