Description Usage Arguments Details Value Author(s) Examples
Given raw data or known sample correlations, test whether correlation/covariance values are equivalent within a specified interval. The null hypothesis is that the groups are not equivalent in degree of association between two variables.
1 2 3 4 5 |
dat1 |
a matrix or data.frame containing raw data used to compute the first correlation/ covariance. A scalar input may be used as well specifying the sample correlation directly |
dat2 |
a matrix or data.frame containing raw data used to compute the second correlation/ covariance. A scalar input may be used as well specifying the sample correlation directly |
equiv_int |
equivalence interval |
n1 |
sample size for first covariance set (required when input is a correlation) |
n2 |
sample size for second covariance set (required when input is a correlation) |
betas |
logical; compare raw beta regression coefficients rather than correlations? |
alpha |
desired alpha level |
x |
object of class |
... |
additional arguments to be passed |
Function uses Anderson and Hauck's (1983) equivalence test. Because the p-value derived from the test is only an approximation, the CIs may produce results that fall outside of the equivalence interval at small sample sizes, even with a statistically significant p-value. They therefore provide a measure of precision, but cannot be used as a reject/fail to reject decision regarding the null hypothesis.
returns a list containing the coefficients, the equivalence interval, p-value, and statistical decision
Rob Cribbie cribbie@yorku.ca and Alyssa Counsell counsela@yorku.ca
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
#raw data
set.seed(1234)
dat1 <- cbind(rnorm(100), rnorm(100))
dat2 <- cbind(rnorm(200), rnorm(200))
equiv_rs(dat1, dat2, .2)
equiv_rs(dat1, dat2, .2, betas = TRUE)
par(mfrow=c(1,2))
plot(dat1)
plot(dat2)
par(mfrow=c(1,1))
#correlations input
r1 <- cor(dat1)[2,1]
r2 <- cor(dat2)[2,1]
equiv_rs(r1, r2, .2, n1 = 100, n2 = 200)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.