Skip to contents

Semi-partial (part) correlation

Usage

semi_partial_correlation(x, y, covariates)

Arguments

x, y

Numeric vectors of interest.

covariates

Matrix or data frame of covariates.

Value

An object of class "morie_test_result".

Examples

set.seed(1)
z <- matrix(rnorm(90), nrow = 30)
x <- rnorm(30); y <- x + rnorm(30)
semi_partial_correlation(x, y, z)
#> Semi-partial correlation
#> ------------------------
#>   statistic = 0.601193
#>   p-value   = 0.000442183
#>   estimate  = 0.601193
#>   effect    = 0.361433
#>   n         = 30