
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)
A list containing the correlations, standardized regression coefficients (betas), partial correlations, semi-partial correlations, t-test values, and p values.
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.
The names of one or more continuous variables in data.
Example: Y = c('var1', 'var2', 'var3')
The names of one or more continuous variables in data to be partialled
out of the Y variable correlations.
Example: C = c('var4', 'var5')
The names of one or more continuous predictor variables in data.
Example: X = c('var6', 'var7', 'var8')
The number of cases. Required only when the input (data) is a correlation matrix.
Should detailed results be displayed in console?
The options are: TRUE (default) or FALSE.
Brian P. O'Connor
Y must be provided along with either one, or both, of C and X. Y, C, and X can be the names of single variables or of multiple variables.
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.
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)
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'))
Run the code above in your browser using DataLab