View source: R/Paired_T_test.R
| test_t_paired | R Documentation |
Performs a paired t-test to compare the means of two related measurements,
such as before-and-after observations, using two numeric vectors of equal
length or two numeric columns from a data frame.
Includes four visualization styles: boxplot, violin,
mono, and halfeye.
test_t_paired(
...,
title = "Paired t-test",
xlab = "",
ylab = "Value",
style = c("boxplot", "violin", "mono", "halfeye"),
colors = NULL,
connect = TRUE,
help = FALSE,
verbose = TRUE
)
... |
Two numeric vectors of equal length, or a data frame containing exactly two numeric columns. |
title |
Character string specifying whether to display a plot title or providing the title text, depending on the function implementation. |
xlab |
Character string specifying the x-axis label. |
ylab |
Character string specifying the y-axis label. |
style |
Character string specifying the plot style generated by the
function. One of |
colors |
Optional character vector specifying the plot colors. |
connect |
Logical. If |
help |
Logical. If |
verbose |
Logical. If |
An invisible list containing the following components:
summary_tableSummary statistics, including group means and standard deviations.
test_resultResult object returned by
stats::t.test, containing the paired t-test results.
dataData frame containing the data used for plotting.
plotPlot object generated using ggplot2.
before <- c(13, 12, 15, 14)
after <- c(9, 11, 10, 10)
test_t_paired(before, after)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.