Learn R Programming

pervasive (version 1.0)

pervasive_tric: Association Rule Mining With Trichotomized Data

Description

This function extracts a specific set of association rules and reports quality measures for these rules. The OPCP and adjusted R-square for the regression model analyzed are also reported for a fuller pervasiveness context of the regression.

Usage

pervasive_tric(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 trichotomization 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_tric(formula = formula, data = spi_sc_vars)
#From the results, it appears we would be rather unlikely to meet individuals
#with the patterns of personality traits suggested for old and young people
#by a linear regression when data is trichotomized.

example

Run the code above in your browser using DataLab