Learn R Programming

ldamatch (version 1.0.3)

.choose_best_test_statistic: Chooses rows with best test statistic.

Description

Chooses rows with best test statistic.

Usage

.choose_best_test_statistic(
  dat,
  condition,
  covariates,
  halting_test,
  thresh,
  tiebreaker
)

Value

A data.table containing only the rows of dat with for best test statistic values (decided primarily by halting_test, then by tiebreaker).

Arguments

dat

A data.table with an ind column with indices for items to consider dropping.

condition

A factor vector containing condition labels.

covariates

A columnwise matrix containing covariates to match the conditions on.

halting_test

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.

thresh

The return value of halting_test has to be greater than or equal to thresh for the matched groups.

tiebreaker

NULL, or a function similar to halting_test, used to decide between cases for which halting_test yields equal values.