Learn R Programming

psych (version 1.0-97)

set.cor: Set Correlation and Multiple Regression from raw or matrix input

Description

Finds Cohen's Set Correlation between a predictor set of variables (x) and a criterion set (y). Also finds multiple correlations between x variables and each of the y variables. Will work with either raw data or a correlation matrix. A set of covariates (z) can be partialled from the x and y sets.

Usage

set.cor(y, x,data, z=NULL,n.obs=NULL,use="pairwise")
mat.regress(y, x,data, z=NULL,n.obs=NULL)

Arguments

data
a matrix or data.frame of correlations or, if not square, of raw data
y
either the column numbers of the y set (e.g., c(2,4,6) or the column names of the y set (e.g., c("Flags","Addition")
x
either the column numbers of the x set (e.g., c(1,3,5) or the column names of the x set (e.g. c("Cubes","PaperFormBoard")
n.obs
If specified, then confidence intervals, etc. are calculated, not needed if raw data are given
z
the column names or numbers of the set of covariates
use
find the correlations "pairwise" (default) or just use "complete" cases (to match the lm function)

Value

  • betathe beta weights for each variable in X for each variable in Y
  • RThe multiple R for each equation (the amount of change a unit in the predictor set leads to in the criterion set).
  • R2The multiple R2 (% variance acounted for) for each equation
  • setR2The multiple R2 of the set correlation between the x and y sets
  • .

Details

Cohen (1982) introduced the set correlation, a multivariate generalization of the multiple correlation. Set correlation is the amount of shared variance (R2) between two sets of variables. With the addition of a third, covariate set, set correlation will find multivariate R2, as well as partial and semi partial R2. (The semi and bipartial options are not yet implemented.) Details on set correlation may be found in Cohen (1982) Cohen, Cohen, Aiken and West (2003). Although it is more common to calculate multiple regression from raw data, it is, of course, possible to do so from a set of correlations. In this case, the input to the function is a square covariance or correlation matrix, as well as the column numbers (or names) of the x (predictor) and y (criterion) variables. The program will find the correlations if given raw data. The output is a set of multiple correlations, one for each dependent variable in the y set. An additional output is the R2 found using Cohen's set correlation (Cohen, 1982). This is a measure of how much variance and the x and y set share. A typical use in the SAPA project is to form item composites by clustering or factoring (see ICLUST, principal), extract the clusters from these results (factor2cluster), and then form the composite correlation matrix using cluster.cor. The variables in this reduced matrix may then be used in multiple R procedures using mat.regress.

Although the overall matrix can have missing correlations, the correlations in the subset of the matrix used for prediction must exist. If the number of observations is entered, then the conventional confidence intervals, statistical significance, and shrinkage estimates are reported. If the input is rectangular, correlations are found from the data. The print function reports t and p values for the beta weights, the summary function just reports the beta weights.

References

J. Cohen (1982) Set correlation as a general mulitivariate data-analytic method. Multivariate Behavioral Research, 17(3):301-341.

J. Cohen, P. Cohen, S.G. West, and L.S. Aiken. (2003) Applied multiple regression/correlation analysis for the behavioral sciences. L. Erlbaum Associates, Mahwah, N.J., 3rd ed edition.

See Also

cluster.cor, factor2cluster,principal,ICLUST

Examples

Run this code
set.cor(y=c(7:9),x=c(1:6),data=Thurstone,n.obs=213)
#now try partialling out some variables
set.cor(y=c(7:9),x=c(1:3),z=c(4:6),data=Thurstone) #compare with the previous

set.cor(x=c("gender","education"),y=c("SATV","SATQ"),data=sat.act) # regression from raw data

Run the code above in your browser using DataLab