plot_scatter | R Documentation |
plot_scatter
returns a ggplot2 object of data from two continuous
variables. Can indicate regression line and its confidence
interval,prediction intervals regression residuals and more. This function
requires as input an esci_estimate object generated by estimate_r()
plot_scatter(
estimate,
show_line = FALSE,
show_line_CI = FALSE,
show_PI = FALSE,
show_residuals = FALSE,
show_mean_lines = FALSE,
show_r = FALSE,
predict_from_x = NULL,
plot_as_z = FALSE,
ggtheme = ggplot2::theme_classic()
)
estimate |
|
show_line |
|
show_line_CI |
|
show_PI |
|
show_residuals |
|
show_mean_lines |
|
show_r |
|
predict_from_x |
|
plot_as_z |
|
ggtheme |
|
This function was developed primarily for student use within jamovi when learning along with the text book Introduction to the New Statistics, 2nd edition (Cumming & Calin-Jageman, 2024).
Expect breaking changes as this function is improved for general use. Work still do be done includes:
Revise to avoid deprecated ggplot features
Revise for consistent ability to control aesthetics and consistent layer names
Returns a ggplot object
# 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)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.