Last chance! 50% off unlimited learning
Sale ends in
Calculates matched-pairs rank biserial correlation coefficient effect size for paired Wilcoxon signed-rank test; confidence intervals by bootstrap.
wilcoxonPairedRC(
x,
g = NULL,
zero.method = "Wilcoxon",
ci = FALSE,
conf = 0.95,
type = "perc",
R = 1000,
histogram = FALSE,
digits = 3,
verbose = FALSE,
...
)
A single statistic, rc. Or a small data frame consisting of rc, and the lower and upper confidence limits.
A vector of observations.
The vector of observations for the grouping, nominal variable. Only the first two levels of the nominal variable are used.
If "Wilcoxon"
,
differences of zero are discarded and then ranks
are determined.
If "Pratt"
,
ranks are determined,
and then differences of zero are discarded.
If "none"
,
differences of zero are not discarded.
If TRUE
, returns confidence intervals by bootstrap.
May be slow.
The level for the confidence interval.
The type of confidence interval to use.
Can be any of "norm
", "basic
",
"perc
", or "bca
".
Passed to boot.ci
.
The number of replications to use for bootstrap.
If TRUE
, produces a histogram of bootstrapped values.
The number of significant digits in the output.
If TRUE
, prints information on sample size and ranks.
Additional arguments passed to rank
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
It is recommended that NA
s be removed
beforehand.
When the data in the first group are greater than in the second group, rc is positive. When the data in the second group are greater than in the first group, rc is negative.
Be cautious with this interpretation, as R will alphabetize
groups if g
is not already a factor.
When rc is close to extremes, or with small counts in some cells, the confidence intervals determined by this method may not be reliable, or the procedure may fail.
King, B.M., P.J. Rosopa, and E.W. Minium. 2011. Statistical Reasoning in the Behavioral Sciences, 6th ed.
wilcoxonPairedR
data(Pooh)
Time1 = Pooh$Likert[Pooh$Time==1]
Time2 = Pooh$Likert[Pooh$Time==2]
wilcox.test(x = Time1, y = Time2, paired=TRUE, exact=FALSE)
wilcoxonPairedRC(x = Pooh$Likert, g = Pooh$Time)
### Example from King, Rosopa, and Minium
Placebo = c(24,39,29,28,25,32,31,33,31,22)
Drug = c(28,29,34,21,28,15,17,28,16,12)
Y = c(Placebo, Drug)
Group = factor(c(rep("Placebo", length(Placebo)),
rep("Drug", length(Drug))),
levels=c("Placebo", "Drug"))
wilcoxonPairedRC(x = Y, g = Group)
### Example with some zero differences
A = c(11,12,13,14,15,16,17,18,19,20)
B = c(12,14,16,18,20,22,12,10,19,20)
Y = c(A, B)
Group = factor(c(rep("A", length(A)),
rep("B", length(B))))
wilcoxonPairedRC(x = Y, g = Group, verbose=TRUE, zero.method="Wilcoxon")
wilcoxonPairedRC(x = Y, g = Group, verbose=TRUE, zero.method="Pratt")
wilcoxonPairedRC(x = Y, g = Group, verbose=TRUE, zero.method="none")
Run the code above in your browser using DataLab