# From raw data
data("data_thomason_1")
estimate_from_raw <- esci::estimate_mdiff_paired(
data = esci::data_thomason_1,
comparison_measure = Posttest,
reference_measure = Pretest
)
# To visualize the estimated median difference (raw data only)
myplot_from_raw <- esci::plot_mdiff(estimate_from_raw, effect_size = "median")
# To conduct a hypothesis test
res_htest_from_raw <- esci::test_mdiff(
estimate_from_raw,
effect_size = "median",
rope = c(-2, 2)
)
sd1 <- 4.28
sd2 <- 3.4
sdiff <- 2.13
cor <- (sd1^2 + sd2^2 - sdiff^2) / (2*sd1*sd2)
estimate_from_summary <- esci::estimate_mdiff_paired(
comparison_mean = 14.25,
comparison_sd = 4.28,
reference_mean = 12.88,
reference_sd = 3.4,
n = 16,
correlation = 0.87072223749,
comparison_measure_name = "After",
reference_measure_name = "Before"
)
# To visualize the estimated mean difference
myplot_from_summary <- esci::plot_mdiff(
estimate_from_summary,
effect_size = "mean"
)
# To conduct a hypothesis test
res_htest_from_summary <- esci::test_mdiff(
estimate_from_summary,
effect_size = "mean",
rope = c(-2, 2)
)
Run the code above in your browser using DataLab