Skip to contents

Create a summary table for a one-sample mean hypothesis test

Usage

infer_1mean_test(
  data,
  formula,
  digits = 3,
  mu0 = 0,
  conf_lvl = 0.95,
  caption = NULL
)

Arguments

data

A data frame (or tibble).

formula

The variable to run the test on, in formula syntax, ~var.

digits

The number of digits to round table values to. Defaults to 3.

mu0

The null hypothesis value. Defaults to 0.

conf_lvl

The confidence level of the interval, entered as a value between 0 and 1. Defaults to 0.95.

caption

An override to the table caption. A sensible default is provided.

Value

An object of class flextable. In an interactive environment, results are viewable immediately.

Examples

infer_1mean_test(mtcars, ~wt)
One-Sample Mean Test on Variable wt
Null Value: 0

n Used

n
Missing

Standard
Error

t

Degrees of
Freedom

p-value
(2 tail)

32

0

3.217

0.173

18.600

31

< 0.0001

infer_1mean_test(mtcars, ~wt, mu0 = 3)
One-Sample Mean Test on Variable wt
Null Value: 3

n Used

n
Missing

Standard
Error

t

Degrees of
Freedom

p-value
(2 tail)

32

0

3.217

0.173

1.256

31

0.218

infer_1mean_test(mtcars, ~wt, digits = 4, conf_lvl = 0.90)
One-Sample Mean Test on Variable wt
Null Value: 0

n Used

n
Missing

Standard
Error

t

Degrees of
Freedom

p-value
(2 tail)

32

0

3.2172

0.1730

18.6002

31

< 0.0001