psych (version 1.3.12)

mixed.cor: Find correlations for mixtures of continuous, polytomous, and dichotomous variables

Description

For data sets with continuous, polytomous and dichotmous variables, the absolute Pearson correlation is downward biased from the underlying latent correlation. mixed.cor finds Pearson correlations for the continous variables, polychorics for the polytomous items, tetrachorics for the dichotomous items, and the polyserial or biserial correlations for the various mixed variables. Results include the complete correlation matrix, as well as the separate correlation matrices and difficulties for the polychoric and tetrachoric correlations.

Usage

mixed.cor(x = NULL, p = NULL, d=NULL,smooth=TRUE, correct=TRUE,global=TRUE, 
        ncat=8, polycor=FALSE,use="pairwise",method="pearson",weight=NULL)

Arguments

x
A set of continuous variables (may be missing) or, if p and d are missing, the variables to be analyzed.
p
A set of polytomous items (may be missing)
d
A set of dichotomous items (may be missing)
smooth
If TRUE, then smooth the correlation matix if it is non-positive definite
correct
When finding tetrachoric correlations, should 0 values be corrected for continuity?
global
For polychorics, should the global values of the tau parameters be used, or should the pairwise values be used. Set to local if errors are occurring.
ncat
The number of categories beyond which a variable is considered "continuous".
polycor
Should the polycor function from the polychor package be used?
use
The various options to the cor function include "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs". The default here is "pairwise"
method
The correlation method to use for the continuous variables. "pearson" (default), "kendall", or "spearman"
weight
If specified, this is a vector of weights (one per participant) to differentially weight participants. The NULL case is equivalent of weights of 1 for all cases.

Value

  • rhoThe complete matrix
  • rxThe Pearson correlation matrix for the continuous items
  • polythe polychoric correlation (poly$rho) and the item difficulties (poly$tau)
  • tetrathe tetrachoric correlation (tetra$rho) and the item difficulties (tetra$tau)

Details

This function is particularly useful as part of the Synthetic Apeture Personality Assessment (SAPA) (http://sapa-project.org) data sets where continuous variables (age, SAT V, SAT Q, etc) and mixed with polytomous personality items taken from the International Personality Item Pool (IPIP) and the dichotomous experimental IQ items that have been developed as part of SAPA (see, e.g., Revelle, Wilt and Rosenthal, 2010).

Item response analyses using irt.fa may be done separately on the polytomous and dichotomous items in order to develop internally consistent scales. These scale may, in turn, be correlated with each other using the complete correlation matrix found by mixed.cor and using the score.items function.

This function is not quite as flexible as the hetcor function in John Fox's polychor package.

Note that the variables may be organized by type of data: first continuous, then polytomous, then dichotomous. This is advantageous

References

W.Revelle, J.Wilt, and A.Rosenthal. Personality and cognition: The personality-cognition link. In A.Gruszka, G. Matthews, and B. Szymura, editors, Handbook of Individual Differences in Cognition: Attention, Memory and Executive Control, chapter 2, pages 27-49. Springer, 2010.

See Also

polychoric, tetrachoric, score.items, score.irt

Examples

Run this code
data(bfi) 
r <- mixed.cor(bfi[,c(1:5,26,28)])
r
#compare to raw Pearson
#note that the biserials and polychorics are not attenuated
rp <- cor(bfi[c(1:5,26,28)],use="pairwise")
lowerMat(rp)

Run the code above in your browser using DataLab