View source: R/nonparametric.R
| signrank | R Documentation |
Performs a one-sample or paired Wilcoxon signed-rank test. With two variables,
complete pairs are analyzed and the tested difference is x - y.
signrank(
x,
y = NULL,
data = NULL,
mu = 0,
alternative = c("two.sided", "less", "greater"),
exact = NULL,
correct = TRUE,
conf.int = TRUE,
level = 0.95,
digits = 3,
p_digits = 3,
show = TRUE,
console = FALSE
)
x |
Numeric variable or first paired measurement. |
y |
Optional second paired measurement. |
data |
Data frame. If |
mu |
Null median or null median paired difference. |
alternative |
Alternative hypothesis. |
exact |
Use an exact p-value when possible. |
correct |
Apply continuity correction for the normal approximation. |
conf.int |
Report a pseudomedian or paired location-shift estimate and confidence interval when available. |
level |
Confidence level. |
digits, p_digits |
Decimal places for estimates and p-values. |
show |
Logical; open the formatted result in the Viewer. Default |
console |
Logical; also print the traditional result in the Console. Default |
Invisibly returns an object of class r4vn_stat.
d <- data.frame(
before = c(18, 20, 15, 22, 17, 19, 24, 16),
after = c(15, 18, 14, 19, 16, 17, 20, 15)
)
signrank(before, data = d, mu = 18)
signrank(before, after, data = d)
signrank(before, after, data = d, alternative = "greater")
# Extended usage examples
d <- data.frame(
before = c(18, 20, 15, 22, 17, 19, 24, 16),
after = c(15, 18, 14, 19, 16, 17, 20, 15)
)
# One-sample signed-rank test against a specified median
signrank(before, data = d, mu = 18)
# Paired signed-rank test; the analyzed difference is before - after
signrank(before, after, data = d)
signrank(before, after, data = d, alternative = "greater")
# Approximation and confidence-interval controls
signrank(before, after, data = d, exact = FALSE, correct = FALSE)
signrank(before, after, data = d, conf.int = FALSE)
usedf(d)
signrank(before, after)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.