Learn R Programming

mariposa (version 0.7.3)

phi: Effect Sizes for Contingency Tables

Description

Convenience helpers that run chi_square and return just the requested effect size as a numeric value (named by group for grouped data): phi() for 2x2 tables, cramers_v() for larger tables, and goodman_gamma() for ordinal variables.

For the full test output (chi-square statistic, p-value, all effect sizes), call chi_square directly.

Usage

phi(data, ..., weights = NULL)

cramers_v(data, ..., weights = NULL)

goodman_gamma(data, ..., weights = NULL)

Value

A numeric vector with the effect size (one element per group for grouped data).

Arguments

data

Your survey data (a data frame or tibble)

...

Exactly two categorical variables, as in chi_square()

weights

Optional survey weights

See Also

chi_square

Examples

Run this code
data(survey_data)
phi(survey_data, gender, region)
cramers_v(survey_data, education, region)
goodman_gamma(survey_data, education, life_satisfaction)

Run the code above in your browser using DataLab