Learn R Programming

pervasive (version 1.0)

pervasive_dic_glm: Association Rule Mining With Dichotomized Data

Description

This function provides similar information as pervasive_dic() and pervasive_tric() but should be the preferred option when the outcome variable is binary.

Usage

pervasive_dic_glm(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(sex, Agree, Consc, Neuro, Extra, Open)
spi_sc_vars$sex = spi_sc_vars$sex -1

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

Run the code above in your browser using DataLab