build.dist.struct {rcbalance}R Documentation

Build Distance Structure for Matching with Refined Balance

Description

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.

Usage

build.dist.struct(z, X, exact = NULL, calip.option = "propensity",
calip.cov = NULL, caliper = 0.2, verbose = FALSE)

Arguments

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 z.

exact

an optional vector of the same length as z. If this argument is specified, treated units will only be allowed to match to control units that have equal values in the corresponding indices of the exact vector. For example, to match patients within hospitals only, one could set exact equal to a vector of hospital IDs for each patient.

calip.option

one of ('propensity','user','none'). If 'propensity' is specified (the default option), the function estimates a propensity score via logistic regression of z on X and imposes a propensity score caliper. If 'user' is specified, the user must provide a vector of values on which a caliper will be enforced using the calip.cov argument. If 'none' is specified no caliper is used.

calip.cov

see calip.option.

caliper

gives the size of the caliper when the user specifies the calip.option argument as 'propensity' or 'calip.cov'.

verbose

if TRUE, prints output describing specific adjustments made in creating the distance objects.

Details

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).

Value

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.

Author(s)

Samuel D. Pimentel

See Also

rcbalance


[Package rcbalance version 1.8.8 Index]