Learn R Programming

pervasive (version 1.0)

pervasive_dic: Association Rule Mining With Dichotomized Data

Description

This function provides the same information as pervasive_tric but with dichotomized data instead of trichotomized data. Trichotomized data is generally to be preferred when possible. Researchers interested in mixing trichotomized variables with dichotomized variables should use the arules package directly.

Usage

pervasive_dic(formula, data, min_support = 0.03)

Value

@return A list with the following components:

  • OPCP: Observed proportion of concordant pairs.

  • adj_r_squared: Adjusted R-squared value for the regression model.

  • exact_match_lhs, exact_match_rhs: The left and right-hand side of the rule suggested by the regression model, respectively

  • exact_match_quality: Quality metrics for the rule suggested by the regression.

  • exact_match_lhs_opp, exact_match_rhs_opp: The left and right-hand side of the rule suggested by the low end of the regression model, respectively

  • exact_match_quality_opp: Quality metrics for the rule suggested by the low end of the regression.

  • top_rule_lhs, top_rule_rhs, top_rule_quality: Information relevant to the highest lift rule meeting min_support for high values of the dependent variable.

  • top_rule_opp_lhs, top_rule_opp_rhs, top_rule_opp_quality: Information relevant to the highest lift rule meeting min_support for low values of the dependent variable.

  • quality_table: A table summarizing the quality statistics for extracted association rules.

  • freq_tables: Frequency tables (cutoffs and membership) for dichotomization binning.

Arguments

formula

A formula specifying the dependent and independent variables.

data

A data frame containing the variables specified in the formula.

min_support

The minimum proportion of rows that a rule must have to be considered for top rules.

Examples

Run this code
# Example using the spi dataset from the psychTools package
sc <- psych::scoreVeryFast(psychTools::spi.keys, psychTools::spi)
spi_sc <- cbind(psychTools::spi, sc)
spi_sc_vars <- spi_sc |>
  dplyr::select(age, Agree, Consc, Neuro, Extra, Open)

formula <- age ~ Agree + Consc + Neuro + Extra + Open
example <- pervasive_dic(formula = formula, data = spi_sc_vars)
example

Run the code above in your browser using DataLab