# From raw data
data("data_thomason_1")
estimate_from_raw <- esci::estimate_r(
esci::data_thomason_1,
Pretest,
Posttest
)
# To visualize the value of r
myplot_correlation <- esci::plot_correlation(estimate_from_raw)
# To visualize the data (scatterplot) and use regression to obtain Y' from X
myplot_scatter_from_raw <- esci::plot_scatter(estimate_from_raw, predict_from_x = 10)
# To evaluate a hypothesis (interval null from -0.1 to 0.1):
res_htest_from_raw <- esci::test_correlation(
estimate_from_raw,
rope = c(-0.1, 0.1)
)
# From summary data
estimate_from_summary <- esci::estimate_r(r = 0.536, n = 50)
# To visualize the value of r
myplot_correlation_from_summary <- esci::plot_correlation(estimate_from_summary)
# To evaluate a hypothesis (interval null from -0.1 to 0.1):
res_htest_from_summary <- esci::test_correlation(
estimate_from_summary,
rope = c(-0.1, 0.1)
)
Run the code above in your browser using DataLab