test_pdiff {esci}R Documentation

Test a hypothesis about a difference in proportion

Description

test_pdiff is suitable for testing a hypothesis about a difference in proportions between two conditions with a categorical outcome variable. It can test hypotheses for both independent and paired designs.

Usage

test_pdiff(estimate, rope = c(0, 0), output_html = FALSE)

Arguments

estimate
  • An esci_estimate object generated by an estimate_pdiff_ function

rope
  • A two-element vector defining the Region of Practical Equivalence (ROPE). Specify c(0, 0) to test a point null of exactly 0. Specify any two ascending values between -1 and 1 to test an interval null (e.g. c(-.25, .25) to test the hypothesis that the difference in proportion is between -.25 and .25).

output_html
  • TRUE to return results in HTML; FALSE (default) to return standard output

Details

This function can be passed an esci_estimate object generated by estimate_pdiff_one(), estimate_pdiff_two(), estimate_pdiff_paired(), or estimate_pdiff_ind_contrast().

It can test hypotheses about a specific value for the difference (a point null) or about a range of values (an interval null)

Value

Returns a list with 1-2 data frames

Examples

estimate <- estimate_pdiff_two(
  comparison_cases = 10,
  comparison_n = 20,
  reference_cases = 78,
  reference_n = 252,
  grouping_variable_levels = c("Original", "Replication"),
  conf_level = 0.95
)

# Test against null of exactly
test_pdiff(estimate)

# Test against null of (-0.1, 0.1)
test_pdiff(estimate, rope = c(-0.1, 0.1))


[Package esci version 1.0.2 Index]