Dominance statistic for two-sample paired data
pairedSampleDominance.RdCalculates a dominance effect size statistic for two-sample paired data with confidence intervals by bootstrap
Usage
pairedSampleDominance(
formula = NULL,
data = NULL,
x = NULL,
y = NULL,
ci = FALSE,
conf = 0.95,
type = "perc",
R = 1000,
histogram = FALSE,
digits = 3,
na.rm = TRUE,
...
)Arguments
- formula
A formula indicating the response variable and the independent variable. e.g. y ~ group.
- data
The data frame to use.
- x
If no formula is given, the response variable for one group.
- y
The response variable for the other group.
- ci
If
TRUE, returns confidence intervals by bootstrap. May be slow.- conf
The level for the confidence interval.
- type
The type of confidence interval to use. Can be any of "
norm", "basic", "perc", or "bca". Passed toboot.ci.- R
The number of replications to use for bootstrap.
- histogram
If
TRUE, produces a histogram of bootstrapped values.- digits
The number of significant digits in the output.
- na.rm
If
TRUE, removesNAvalues from the input vectors or data frame.- ...
Additional arguments.
Value
A small data frame consisting of descriptive statistics, the dominance statistic, and potentially the lower and upper confidence limits.
Details
The calculated Dominance statistic is simply
the proportion of observations in x greater the paired
observations in y,
minus
the proportion of observations in x less than the paired
observations in y
It will range from -1 to 1, with
and 1 indicating that
the all the observations in x are greater than
the paired observations in y,
and -1 indicating that
the all the observations in y are greater than
the paired observations in x.
The input should include either formula and data;
or x, and y. If there are more than two groups,
only the first two groups are used.
This statistic is appropriate for truly ordinal data, and could be considered an effect size statistic for a two-sample paired sign test.
Ordered category data need to re-coded as
numeric, e.g. as with as.numeric(Ordinal.variable).
When the statistic is close to 1 or close to -1, or with small sample size, the confidence intervals determined by this method may not be reliable, or the procedure may fail.
VDA is the analogous statistic, converted to a probability,
ranging from 0 to 1, specifically,
VDA = Dominance / 2 + 0.5
Author
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
Examples
data(Pooh)
Time.1 = Pooh$Likert[Pooh$Time == 1]
Time.2 = Pooh$Likert[Pooh$Time == 2]
library(DescTools)
SignTest(x = Time.1, y = Time.2)
#>
#> Dependent-samples Sign-Test
#>
#> data: Time.1 and Time.2
#> S = 1, number of differences = 9, p-value = 0.03906
#> alternative hypothesis: true median difference is not equal to 0
#> 97.9 percent confidence interval:
#> -2 0
#> sample estimates:
#> median of the differences
#> -1
#>
pairedSampleDominance(x = Time.1, y = Time.2)
#> n Less Equal Greater Dominance VDA
#> 1 10 0.8 0.1 0.1 -0.7 0.15
pairedSampleDominance(Likert ~ Time, data=Pooh)
#> n Less Equal Greater Dominance VDA
#> 1 10 0.8 0.1 0.1 -0.7 0.15