# From raw data
data("data_penlaptop1")
estimate_from_raw <- esci::estimate_mdiff_one(
data = data_penlaptop1[data_penlaptop1$condition == "Pen", ],
outcome_variable = transcription,
reference_mean = 10
)
# To visualize the mean difference estimate
myplot_from_raw <- esci::plot_mdiff(estimate_from_raw, effect_size = "mean")
# To conduct a hypothesis test
res_htest_from_raw <- esci::test_mdiff(
estimate_from_raw,
effect_size = "mean",
rope = c(-2, 2)
)
# From summary data
mymean <- 12.09
mysd <- 5.52
myn <- 103
estimate_from_summary <- esci::estimate_mdiff_one(
comparison_mean = mymean,
comparison_sd = mysd,
comparison_n = myn,
reference_mean = 12
)
# To visualize the estimate
myplot_from_sumary <- 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