tidy_stats.htest: Create a tidy stats data frame from an htest object

Description Usage Arguments Examples

View source: R/tidy_stats.htest.R

Description

tidy_stats.htest takes an htest object and converts the object to a tidy stats data frame.

Usage

1
2
## S3 method for class 'htest'
tidy_stats(model, args = NULL)

Arguments

model

Output of t.test().

args

Unused.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Conduct a t-test
model_t_test <- t.test(extra ~ group, data = sleep)
tidy_stats(model_t_test)

# Conduct a correlation
x <- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1)
y <- c( 2.6,  3.1,  2.5,  5.0,  3.6,  4.0,  5.2,  2.8,  3.8)

model_correlation <- cor.test(x, y)
tidy_stats(model_correlation)

# Conduct a chi-square test
M <- as.table(rbind(c(762, 327, 468), c(484, 239, 477)))

model_chi_square <- chisq.test(M)
tidy_stats(model_chi_square)

WillemSleegers/tidystats-v0.3 documentation built on Aug. 12, 2019, 5:31 p.m.