| PARTIAL_COR | R Documentation |
Produces partial correlations between two or more variables (in set Y) while statistically controlling for one or more covariates (set C). It also produces partial correlations, semipartial correlations, and standardized regression coefficients for predicting variables (in set Y) from one or more set X variables.
PARTIAL_COR(data, Y, X=NULL, C=NULL, Ncases=NULL, verbose=TRUE)
data |
Either a dataframe of raw data (where the rows are cases and the columns are the variables), or a square correlation matrix with row and column names. |
Y |
The names of one or more continuous variables in data.
|
C |
The names of one or more continuous variables in data to be partialled
out of the Y variable correlations.
|
X |
The names of one or more continuous predictor variables in data.
|
Ncases |
The number of cases. Required only when the input (data) is a correlation matrix. |
verbose |
Should detailed results be displayed in console?
|
Y must be provided along with either one, or both, of C and X.
If Y and C are provided, but not X, then the function computes:
the correlations between the Y variables after partialling the C variables out of the Y variables.
If Y and X are provided, but not C, then the function computes:
the standardized betas for the X variables predicting the Y variables;
the partial correlations for the X variables predicting the Y variables. In other words, for any given X variable, the other X variables are partialled out of both the given X variable and the Y variables. And,
the semi-partial correlations for the X variables predicting the Y variables. In other words, for any given X variable, the other X variables are partialled out of the given X variable and the Y variables remain as they are, untouched.
If Y, X, and C are provided, then the function computes:
the correlations between the Y variables after partialling the C variables out of the Y variables;
the betas for the X variables predicting the C-partialled Y variables;
the partial correlations for the X variables predicting the C-partialled Y variables. In other words, for any given X variable, the other X variables are partialled out of both the given X variable and the C-partialled Y variables. And,
the semi-partial correlations for the X variables predicting the C-partialled Y variables. In other words, for any given X variable, the other X variables are partialled out of the given X variable but not out of the C-partialled Y variables.
A list containing the correlations, standardized regression coefficients (betas), partial correlations, semi-partial correlations, t-test values, and p values.
Brian P. O'Connor
Cohen, J., Cohen, P., West, S. G., & Aiken, L. S. (2003). Applied multiple regression/correlation analysis for the behavioral sciences (3rd ed.). Lawrence Erlbaum Associates.
# C, but no X variables
PARTIAL_COR(data = data_DeLeo_2013,
Y = c('Problematic_Internet_Use','Tobacco_Use','Alcohol_Use','Illicit_Drug_Use'),
C = c('Age','Parents_Income'),
X = NULL)
# X, but no C variables
PARTIAL_COR(data = data_DeLeo_2013,
Y = c('Problematic_Internet_Use','Tobacco_Use','Alcohol_Use','Illicit_Drug_Use'),
C = NULL,
X = c('Impulsivity','Social_Interaction_Anxiety',
'Social_Support','Intolerance_of_Deviance','Family_Morals',
'Grade_Point_Average','Depression','Family_Conflict'))
# both X & C variables
PARTIAL_COR(data = data_DeLeo_2013,
Y = c('Problematic_Internet_Use','Tobacco_Use','Alcohol_Use','Illicit_Drug_Use'),
C = c('Age','Parents_Income'),
X = c('Impulsivity','Social_Interaction_Anxiety',
'Social_Support','Intolerance_of_Deviance','Family_Morals',
'Grade_Point_Average','Depression','Family_Conflict'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.