test_mdiff {esci}R Documentation

Test a hypothesis about a difference in a continuous outcome variable.

Description

test_mdiff is suitable for conducting a testing a hypothesis about the magnitude of difference between two conditions for a continuous outcome variable. It can test hypotheses about differences in means or medians for both independent and paired designs.

Usage

test_mdiff(
  estimate,
  effect_size = c("mean", "median"),
  rope = c(0, 0),
  rope_units = c("raw", "sd"),
  output_html = FALSE
)

Arguments

estimate
  • An esci_estimate object generated by an estimate_mdiff_ function

effect_size
  • One of 'mean' or 'median'. The effect size selected must be available in the esci_estimate object; medians are only available when the estimate was generated from raw data.

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 to test an interval null (e.g. c(-1, 1) to test the hypothesis tha the difference is between -1 and 1).

rope_units
  • One of 'raw' (default) or 'sd', specifies the units of the ROPE. If 'sd' is specified, the rope is defined in standard deviation units (e.g. c(-1, 1) is taken as between -1 and 1 standard deviations from 0). When sd is used, the ROPE is converted to raw scores and then the test is conducted on raw scores.

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_mdiff_one(), estimate_mdiff_two(), estimate_mdiff_paired(), or estimate_mdiff_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

# example code
data("data_penlaptop1")

estimate <- esci::estimate_mdiff_two(
  data = data_penlaptop1,
  outcome_variable = transcription,
  grouping_variable = condition,
  switch_comparison_order = TRUE,
  assume_equal_variance = TRUE
)

# Test mean difference against point null of 0
esci::test_mdiff(
  estimate,
  effect_size = "mean"
)

# Test median difference against point null of 0
#  Note that t, df, p return NA because test is completed
#  by interval.
esci::test_mdiff(
  estimate,
  effect_size = "median"
)

# Test mean difference against interval null of -10 to 10
esci::test_mdiff(
  estimate,
  effect_size = "mean",
  rope = c(-10, 10)
)

# Test mean difference against interval null of d (-0.20, 0.20) d = 0.2 is often
# thought of as a small effect, so this test examines if the effect is
# negligible (clearly between negligble and small), substantive (clearly more
# than small), or unclear. The d boundaries provided are converted to raw scores
# and then the CI of the observed effect is compared to the raw-score boundaries
esci::test_mdiff(
  estimate,
  effect_size = "mean",
  rope = c(-0.2, 0.2),
  rope_units = "sd"
)



[Package esci version 1.0.2 Index]