View source: R/hypothesis_evaluation.R
test_mdiff | R Documentation |
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.
test_mdiff(
estimate,
effect_size = c("mean", "median"),
rope = c(0, 0),
rope_units = c("raw", "sd"),
output_html = FALSE
)
estimate |
|
effect_size |
|
rope |
|
rope_units |
|
output_html |
|
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)
Returns a list with 1-2 data frames
point_null - always returned
test_type - 'Nil hypothesis test', meaning a test against H0 = 0
outcome_variable_name - Name of the outcome variable
effect - Label for the effect being tested
null_words - Express the null in words
confidence - Confidence level, integer (95 for 95%, etc.)
LL - Lower boundary of the confidence% CI for the effect
UL - Upper boundary of the confidence% CI for the effect
CI - Character representation of the CI for the effect
CI_compare - Text description of relation between CI and null
t - If applicable, t value for hypothesis test
df - If applicable, degrees of freedom for hypothesis test
p - If applicable, p value for hypothesis test
p_result - Text representation of p value obtained
null_decision - Text represention of the decision for the null
conclusion - Text representation of conclusion to draw
significant - TRUE/FALSE if significant at alpha = 1-CI
interval_null - returned only if an interval null is specified
test_type - 'Practical significance test', meaning a test against an interval null
outcome_variable_name -
effect - Name of the outcome variable
rope - Test representation of null interval
confidence - Confidence level, integer (95 for 95%, etc.)
CI - Character representation of the CI for the effect
rope_compare - Text description of relation between CI and null interval
p_result - Text representation of p value obtained
conclusion - Text representation of conclusion to draw
significant - TRUE/FALSE if significant at alpha = 1-CI
# 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"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.