Learn R Programming

generalCorr (version 1.2.0)

parcorHijk: Generalized partial correlation coefficients between Xi and Xj, after removing the effect of Xk, via OLS regression residuals.

Description

This function uses data on two column vectors, xi, xj, and a third xk, which can be a vector or a matrix, usually of the remaining variables in the model, including control variables, if any. It first removes missing data from all input variables. Then, it computes residuals of OLS regression (xi on xk) and (xj on xk). This hybrid version uses both OLS and then generalized correlation among OLS residuals.

Usage

parcorHijk(xi, xj, xk)

Arguments

xi

Input vector of data for variable xi

xj

Input vector of data for variable xj

xk

Input data for variables in xk, usually control variables

Value

ouij

Generalized partial correlation Xi with Xj (=cause) after removing xk

ouji

Generalized partial correlation Xj with Xi (=cause) after removing xk

allowing for control variables.

See Also

See parcor_ijk.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
set.seed(34);x=matrix(sample(1:600)[1:99],ncol=3)
options(np.messages=FALSE)
parcorHijk(x[,1], x[,2], x[,3])
# }
# NOT RUN {
#' 
# }

Run the code above in your browser using DataLab