pcor: Compute first order partial correlations

Description Usage Arguments Value Author(s) See Also Examples

Description

This function computes the first order partial correlation given the k'th variable.

Usage

1
pcor(S, k)

Arguments

S

A numeric correlation matrix

k

An integer. The variable to condition on.

Value

A matrix of the same size as X with NaNs in the k row and column.

Author(s)

Anders Ellern Bilgrau <anders.ellern.bilgrau (at) gmail.com>

See Also

cor

Examples

1
2
3
4
X <- replicate(4, rnorm(10))
dimnames(X) <- list(paste0("obs", 1:nrow(X)), paste0("var", 1:ncol(X)))
S <- cor(X)
pcor(S, 2)

AEBilgrau/Bmisc documentation built on May 5, 2019, 11:28 a.m.