chi_and_odds: chi and odds

View source: R/analysers.R

chi_and_oddsR Documentation

chi and odds

Description

[Questioning]

Takes in a a n x 3 data frame and calculates the chi squared statistic, the p-value of this and the odds ratio.

First column must be the category names. Second column must be observed values (a count) Third column must be the expected values (also a count, but can be weights or probabilities)

Usage

chi_and_odds(m)

Arguments

m

A n x 3 data frame or tibble. Should have variables in a particular order: category_name, observed_count, expected_count

Examples

df <- tibble::tibble(field = c('Yes', 'No') , observed = c(34, 88), expected = c(707, 1021))
chi_and_odds(df)

# or from clipboard
df <- clipr::read_clip_tbl()
chi_and_odds(df)


benwhicks/retention.helpers documentation built on Feb. 6, 2023, 5:02 p.m.