Learn R Programming

RCPA3 (version 1.3.1)

lambda: Calculates Lambda, a measure of association for a cross-tabulation.

Description

Given a table of conditional frequencies, the lambda function calculates and returns Lambda, a measure of association between two categorical variables (factors). Lambda is equal to the proportion of errors reduced by knowledge of the independent variable.

Usage

lambda(tab, digits = 3, detailed = FALSE)

Value

Returns the value of Lambda.

Arguments

tab

The conditional frequencies of a cross-tabulation. The dependent variable should correspond to rows and the independent variable, to columns.

digits

Number of decimal places of Lambda reported (defaults to 3).

detailed

Do you want detailed report on how lambda value calculated? (default is FALSE).

Examples

Run this code
  library(RCPA3)
  
  conditional.frequencies <- table(dv=states$lgbtq.equality.3cat, iv=states$religiosity3)
  lambda(tab=conditional.frequencies, detailed=TRUE)

Run the code above in your browser using DataLab