Learn R Programming

miscor (version 0.1-0)

print.par.cor: Print par.cor

Description

This function prints the par.cor object

Usage

"print"(x, ...)

Arguments

x
par.cor object.
...
further arguments passed to or from other methods.

References

Rasch, D., Kubinger, K. D., & Yanagida, T. (2011). Statistics in psychology - Using R and SPSS. New York: John Wiley & Sons.

See Also

par.cor

Examples

Run this code
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,
               rho = 0.4, alternative = "less", output = FALSE)
print(obj)

Run the code above in your browser using DataLab