dig_contrasts {nuggets}R Documentation

Search for contrast patterns

Description

Search for contrast patterns

Usage

dig_contrasts(
  x,
  condition = where(is.logical),
  xvars = where(is.numeric),
  yvars = where(is.numeric),
  method = "t",
  alternative = "two.sided",
  min_length = 0L,
  max_length = Inf,
  min_support = 0,
  threads = 1,
  ...
)

Arguments

x

a matrix or data frame with data to search in.

condition

a tidyselect expression (see tidyselect syntax) specifying the columns to use as condition predicates

xvars

a tidyselect expression (see tidyselect syntax) specifying the columns to use for computation of contrasts

yvars

a tidyselect expression (see tidyselect syntax) specifying the columns to use for computation of contrasts

method

a character string indicating which contrast to compute. One of "t", "wilcox", or "var". "t" (resp. "wilcos") compute a parametric (resp. non-parametric) test on equality in position, and "var" performs the F-test on equality of variance.

alternative

indicates the alternative hypothesis and must be one of "two.sided", "greater" or "less". "greater" corresponds to positive association, "less" to negative association.

min_length

the minimum size (the minimum number of predicates) of the condition to be generated (must be greater or equal to 0). If 0, the empty condition is generated in the first place.

max_length

The maximum size (the maximum number of predicates) of the condition to be generated. If equal to Inf, the maximum length of conditions is limited only by the number of available predicates.

min_support

the minimum support of a condition to trigger the callback function for it. The support of the condition is the relative frequency of the condition in the dataset x. For logical data, it equals to the relative frequency of rows such that all condition predicates are TRUE on it. For numerical (double) input, the support is computed as the mean (over all rows) of multiplications of predicate values.

threads

the number of threads to use for parallel computation.

...

Further arguments passed to the underlying test function (t.test(), wilcox.test(), or var.test() accordingly to the selected method).

Value

A tibble with found rules.

Author(s)

Michal Burda

See Also

dig(), dig_grid(), stats::t.test(), stats::wilcox.test(), stats::var.test()


[Package nuggets version 1.3.0 Index]