add_prop_test: Title

Description Usage Arguments Value See Also Examples

Description

Title

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
add_prop_test(
  .df,
  x,
  n,
  p = NULL,
  CI_lower_name = "CI_lower",
  CI_upper_name = "CI_upper",
  p_name = "p",
  alternative = c("two.sided", "less", "greater"),
  conf.level = 0.95,
  correct = TRUE
)

Arguments

.df

A data frame

x

The column/vector with the number of positive results

n

The column/vector/constant with the number of trials

p

Assumed proportion: Will add a p-value that the proportion is equal to p (default: 0.5)

CI_lower_name, CI_upper_name, p_name

Column names of the added columns

alternative, conf.level, correct

As for prop.test

Value

Data frame with columns added

See Also

count_by()

Examples

1
2
3
4
5
6
7
library(magrittr)
if (requireNamespace("survival", quietly = TRUE))
{
   survival::aml %>%
   count_by(x) %>%
   add_prop_test(n, sum(n), rel)
}

tidytidbits documentation built on March 8, 2021, 5:07 p.m.