Calculates basic metrics about ldamatch search result.
calc_metrics(
is.in,
condition,
covariates,
halting_test,
props = prop.table(table(condition)),
tiebreaker = NULL
)
A list containing:
all results as a list;
simply the first item in all.is.in or the error contained
in is.in if there was an error running match_groups
;
the number of excluded subjects;
the test statistic from halting_test for the matched groups;
the test statistic from tiebreaker for the matched groups; and
a value characterizing the deviation from the expected group size proportions specified in props.
If the value for a field cannot be calculated, it will still be present with a value of NA.
The output of match_groups()
:
either a logical vector, or a list of those.
A factor vector containing condition labels.
A columnwise matrix containing covariates to match the conditions on.
A function to apply to `covariates` (in matrix form)
which is TRUE iff the conditions are matched.
Signature: halting_test(condition, covariates, thresh).
The following halting tests are part of this package:
t_halt
, U_halt
,
l_halt
, ad_halt
,
ks_halt
, wilks_halt
,
f_halt
.
You can create the intersection of two or more halting
tests using create_halting_test
.
Either the desired proportions (percentage) of the sample for each condition as a named vector, or the names of the conditions for which we prefer to preserve the subjects, in decreasing order of preference. If not specified, the (full) sample proportions are used. This is preferred among configurations with the same taken into account by the other methods to some extent. For example, c(A = 0.4, B = 0.4, C = 0.2) means that we would like the number of subjects in groups A, B, and C to be around 40%, 40%, and 20% of the total number of subjects, respectively. Whereas c("A", "B", "C") means that if possible, we would like to keep all subjects in group A, and prefer keeping subjects in B, even if it results in losing more subjects from C.
NULL, or a function similar to halting_test, used to decide between cases for which halting_test yields equal values.