Usage
GenMatch(Tr, X, BalanceMatrix=X, estimand="ATT", M=1,
weights=NULL,
pop.size = 50, max.generations=100,
wait.generations=4, hard.generation.limit=FALSE,
starting.values=rep(1,ncol(X)),
fit.func="pvals",
data.type.integer=TRUE,
MemoryMatrix=TRUE,
exact=NULL, caliper=NULL,
nboots=0, ks=TRUE, verbose=FALSE,
tolerance = 1e-05,
distance.tolerance=tolerance,
min.weight=0, max.weight=1000,
Domains=NULL, print.level=2,
project.path=NULL,
paired=TRUE, loss=1,
restrict=NULL,
cluster=FALSE, balance=TRUE, ...)
Arguments
Tr
A vector indicating the observations which are
in the treatment regime and those which are not. This can either be a
logical vector or a real vector where 0 denotes control and 1 denotes
treatment.
X
A matrix containing the variables we wish to match on.
This matrix may contain the actual observed covariates or the
propensity score or a combination of both.
BalanceMatrix
A matrix containing the variables we wish
achieve balance on. This is by default equal to X
, but it can
in principle be a matrix which contains more or less variables than
X
or variables which are transformed in vari
estimand
A character string for the estimand. The default
estimand is "ATT", the sample average treatment effect for the
treated. "ATE" is the sample average treatment effect (for all), and
"ATC" is the sample average treatment effect for the controls
M
A scalar for the number of matches which should be
found (with replacement). The default is one-to-one matching.
weights
A vector the same length as Y
which
provides observations specific weights. If none are provides, equal
weights of 1 for each observations are assumed.
pop.size
Population Size. This is the number of individuals
genoud
uses to solve the optimization problem. See
genoud
for more details. max.generations
Maximum Generations. This is the maximum
number of generations that genoud
will run when attempting to
optimize a function. This is a soft limit. The maximum
generation limit w wait.generations
If there is no improvement in the objective
function in this number of generations, genoud
will think that it has
found the optimum. The other variables controlling termination are
hard.generation.limit
This logical variable determines if the max.generations
variable is a binding constraint for genoud
. If
hard.generation.limit
is FALSE, then
starting.values
This vector equal to the number of variables in X
. This
vector contains the starting weights each of the variables is
given. The starting.values
vector is a way for the user
to insert one individual into the
fit.func
The balance metric GenMatch should optimize. The user
may choose from the following or provide one:
pvals
: maximize the p.values uses from a variety of hypothesis
tests.
qqmean.mean
: calculate the mean standardized differe
data.type.integer
By default only integer weights are considered. If this option is
set to false
, search will be done over floating point
weights. This is usually an unnecessary degree of precision.
MemoryMatrix
This variable controls if genoud
sets up a memory matrix. Such a
matrix ensures that genoud
will request the fitness evaluation
of a giv exact
A logical scalar or vector for whether exact matching
should be done. If a logical scalar is
provided, that logical value is applied to all covariates of
X
. If a logical vector is provided, a logical value should
be provided
caliper
A scalar or vector denoting the caliper(s) which
should be used when matching. A caliper is the distance which is
acceptable for any match. Observations which are outside of the
caliper are dropped. If a scalar caliper is provided, this cali
nboots
The number of bootstrap samples to be run for the
ks
test.
ks
A logical flag for if the univariate bootstrap
Kolmogorov-Smirnov (KS) test should be calculated. If the ks option
is set to true, the univariate KS test is calculated for all
non-dichotomous variables. The bootstrap KS test is consistent ev
verbose
If details should be printed of each fit evaluation
done by the genetic algorithm. Verbose is set to FALSE if the
cluster
option is used.
tolerance
This is a scalar which is used to determine
numerical tolerances. This option is used by numerical routines
such as those used to determine if a matrix is singular.
distance.tolerance
This is a scalar which is used to determine if distances
between two observations are different from zero. Values less than
distance.tolerance
are deemed to be equal to zero. This
option can be used to perform a type of optimal
min.weight
This is the minimum weight any variable may be
given.
max.weight
This is the maximum weight any variable may be
given.
Domains
This is a ncol(X)
$\times 2$ matrix.
The first column is the lower bound, and the second column is the
upper bound for each variable over which genoud
will
search for weights. print.level
This option controls the level of printing. There
are four possible levels: 0 (minimal printing), 1 (normal), 2
(detailed), and 3 (debug). If level 2 is selected, GenMatch
will
print details about the population at each generati
project.path
This is the path of the
genoud
project file. By default no file is
produced unless print.level=3
. In that case,
genoud
paired
A flag for if the paired t.test
should be
used when determining balance. loss
The loss function to be optimized. The default value, 1
,
implies "lexical" optimization: all of the balance statistics will
be sorted from the most discrepant to the least and weights will be
picked which minimize the maximum dis
restrict
A matrix which restricts the possible matches. This
matrix has one row for each restriction and three
columns. The first two columns contain the two observation numbers
which are to be restricted (for example 4 and 20), and the third
col
cluster
This can either be an object of the 'cluster' class
returned by one of the makeCluster
commands in
the snow package or a vector of machine names so GenMatch
can
setup the c balance
This logical flag controls if load balancing is done
across the cluster. Load balancing can result in better cluster
utilization; however, increased communication can reduce
performance. This options is best used if each individual call to
...
Other options which are passed on to genoud
.