Learn R Programming

setweaver (version 1.0.0)

pairmi: pairmi

Description

A function that calculates the mutual information for sets of variables, calculates the G statistic, determines the significance of the sets, and only keeps those that are significant.

Usage

pairmi(data, alpha = 0.05, MI.threshold = NULL, n_elements = 5, sep = "_")

Value

A list with the following components:

expanded.data

A data frame containing the original variables and the columns for significant sets (e.g., pair/triplet indicators).

original.variables

Character vector of the original variable names.

sets

A data frame describing significant sets, including their members, size, MI, G statistic, p-value, and constructed name.

Arguments

data

A data frame containing the variables to be paired/combined. Columns should be binary.

alpha

Numeric p-value threshold for significance (default used by the implementation if not supplied).

MI.threshold

Numeric mutual information threshold. If provided, it overrides `alpha`-based filtering.

n_elements

Integer giving the maximum size of sets to evaluate (e.g., `2` for pairs, `3` for triplets). Must be >= 2.

sep

String used to join variable names when forming set identifiers (e.g., `"_"`).

Examples

Run this code
pairmi(misimdata[,2:6])

Run the code above in your browser using DataLab