Description Usage Arguments Author(s) References See Also Examples
This function prints the comptest.cor
object
1 2 |
x |
|
... |
further arguments passed to or from other methods. |
Takuya Yanagida takuya.yanagida@univie.ac.at
Rasch, D., Kubinger, K. D., & Yanagida, T. (2011). Statistics in psychology - Using R and SPSS. New York: John Wiley & Sons.
Zou, G. Y. (2007). Toward using confidence intervals to compare correlation. Psychological Methods, 12, 399-413.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #--------------------------------------
# Dependent samples
# Generate random data
x <- c(3, 2, 2, 3, 7, 8, 5, 9)
y <- c(2, 4, 1, 5, 7, 3, 6, 7)
z <- c(1, 4, 3, 3, 1, 4, 2, 5)
#............................................
# H0: rho.xy == rho.xz, H1: rho.xy != rho.xz
obj <- comptest.cor(x, y, z, output = FALSE)
print(obj)
#...........................................
# H0: rho.xy <= rho.xz, H1: rho.xy > rho.xz
# r.xy = 0.44, r.xz = 0.21. r.yz = 0.20, n = 120
obj <- comptest.cor(r.xy = 0.44, r.xz = 0.21, r.yz = 0.20, n = 120,
alternative = "greater", output = FALSE)
print(obj)
#--------------------------------------
# Independent samples
# Generate random data
dat <- data.frame(group = rep(1:2, each = 200),
rbind(sim.cor(200, rho = 0.3),
sim.cor(200, rho = 0.5)))
#.......................................
# H0: rho.1 == rho.2, H1: rho.1 != rho.2
obj <- comptest.cor(x = dat$x, y = dat$y, group = dat$group,
output = FALSE)
print(obj)
#........................................
# H0: rho.1 >= rho.2, H1: rho.1 ! < rho.2
# Group 1: r = 0.32, n = 108
# Group 2: r = 0.56, n = 113
obj <- comptest.cor(r.1 = 0.32, n.1 = 108, r.2 = 0.56, n.2 = 113,
alternative = "less", output = FALSE)
print(obj)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.