Skip to contents

Create a summary table for a two-sample proportion interval

Usage

infer_2prop_int(
  data,
  formula,
  success,
  digits = 3,
  conf_lvl = 0.95,
  caption = NULL
)

Arguments

data

A data frame (or tibble).

formula

The variables to run the test on, in formula syntax, var1 ~ var2.

success

The data value that constitutes a "success".

digits

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

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_2prop_int(mtcars, vs~am, success = 1)
Two Sample Proportion Interval Between vs and am
Successes: 1
Confidence Level: 95%

am

n
Successes

n

n
Missing

Standard
Error

95%
Interval
Lower

95%
Interval
Upper

0

7

19

0

0.368

0.177

-0.517

0.177

1

7

13

0

0.538

infer_2prop_int(mtcars, vs~am, success = 1, conf_lvl = .9)
Two Sample Proportion Interval Between vs and am
Successes: 1
Confidence Level: 90%

am

n
Successes

n

n
Missing

Standard
Error

90%
Interval
Lower

90%
Interval
Upper

0

7

19

0

0.368

0.177

-0.461

0.121

1

7

13

0

0.538