Learn R Programming

optinterv (version 0.1.0)

par_cor: Partial Correlation

Description

Calculates correlation / covariance between Y and X, holding control constant

Usage

par_cor(Y, X, control = NULL, wgt = rep(1, length(Y)))

Arguments

Y

outcome vector (must be numeric without NA's).

X

numeric data frame or matrix of factors to be considered.

control

numeric data frame or matrix of factors to control for. these are factors that we can't consider while looking for the optimal intervention (e.g. race).

wgt

an optional vector of weights.

Value

data frame with partial correlations, partial covariance & p-values.