Skip to contents

Create a summary table for a paired means test

Usage

infer_paired(
  data,
  var1,
  var2,
  digits = 3,
  mu0 = 0,
  conf_lvl = 0.95,
  caption = NULL
)

Arguments

data

A data frame (or tibble).

var1

The first variable of the pair, entered in formula syntax var1.

var2

The second variable of the pair, entered in formula syntax var2.

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_paired(mtcars, var1 = ~drat, var2 = ~wt)
Difference in Means Test: drat - wt
95% Confidence
Null Value: 0

n

n Missing

Standard Error

t

df

p-value (2 tail)

95% Interval Lower

95% Interval Upper

32

0

0.379

0.249

1.522

31

0.138

-0.129

0.888

infer_paired(mtcars, var1 = ~drat, var2 = ~wt, conf_lvl = 0.9)
Difference in Means Test: drat - wt
90% Confidence
Null Value: 0

n

n Missing

Standard Error

t

df

p-value (2 tail)

90% Interval Lower

90% Interval Upper

32

0

0.379

0.249

1.522

31

0.138

-0.0434

0.802