prop_tests: Compute many proportion tests

prop_testsR Documentation

Compute many proportion tests

Description

This is a convenient tidy wrapper for stat::prop.test()

Usage

prop_tests(
  x,
  group,
  correct = T,
  conf_level = 0.95,
  alternative = c("two.sided", "less", "greater")
)

Arguments

x

A factor variable

group

A grouping variable

correct

a logical indicating whether Yates' continuity correction should be applied where possible.

conf_level

confidence level of the returned confidence interval. Must be a single number between 0 and 1. Only used when testing the null that a single proportion equals a given value, or that two proportions are equal; ignored otherwise.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter. Only used for testing the null that a single proportion equals a given value, or that two proportions are equal; ignored otherwise.

Value

A data frame, which may have missing levels if a combination did not exist in the data.

Examples

prop_tests(mpg$cyl, mpg$manufacturer)

Deleetdk/kirkegaard documentation built on May 2, 2024, 7:12 p.m.