Description Usage Arguments Author(s) References See Also Examples
This function prints the par.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.
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 | dat <- data.frame(x = c(4, 6, 8, 8, 9, 4),
y = c(3, 7, 9, 8, 9, 3),
z = c(1, 3, 4, 4, 5, 2))
#--------------------------------------
# Partial correlation
obj <- par.cor(dat$x, dat$y, p.xy = dat$z, output = FALSE)
print(obj)
#--------------------------------------
# Semipartial correlation
# remove z from x
obj <- par.cor(dat$x, dat$y, p.x = dat$z, output = FALSE)
print(obj)
#--------------------------------------
# Semipartial correlation
# remove z from y
obj <- par.cor(dat$x, dat$y, p.y = dat$y, output = FALSE)
print(obj)
#--------------------------------------
# Partial correlation: Two-sided test
# H0: rho.p == 0, H1: rho.p != 0
obj <- par.cor(dat$x, dat$y, p.xy = dat$z, sig = TRUE,
output = FALSE)
print(obj)
#--------------------------------------
# Partial correlation: One-sided test
# H0: rho.p <= 0.2, H1: rho.p > 0.2
obj <- par.cor(dat$x, dat$y, p.xy = dat$z, sig = TRUE,
rho0 = 0.4, alternative = "less", output = FALSE)
print(obj)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.