Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calculateIndicatorCor

Internal: Calculate indicator correlation matrix


Description

Calculate the indicator correlation matrix using conventional or robust methods.

Usage

calculateIndicatorCor(
  .X_cleaned           = NULL, 
  .approach_cor_robust = "none"
 )

Arguments

.X_cleaned

A data.frame of processed data (cleaned and ordered). Note: X_cleaned may not be scaled!

.approach_cor_robust

Character string. Approach used to obtain a robust indicator correlation matrix. One of: "none" in which case the standard Bravais-Person correlation is used, "spearman" for the Spearman rank correlation, or "mcd" via MASS::cov.rob() for a robust correlation matrix. Defaults to "none". Note that many postestimation procedures (such as testOMF() or fit() implicitly assume a continuous indicator correlation matrix (e.g. Bravais-Pearson correlation matrix). Only use if you know what you are doing.

Details

If .approach_cor_robust = "none" (the default) the type of correlation computed depends on the types of the columns of .X_cleaned (i.e., the indicators) involved in the computation.

Numeric-numeric

If both columns (indicators) involved are numeric, the Bravais-Pearson product-moment correlation is computed (via stats::cor()).

Numeric-factor

If any of the columns is a factor variable, the polyserial correlation (Drasgow 1988) is computed (via polycor::hetcor()).

Factor-factor

If both columns are factor variables, the polychoric correlation (Drasgow 1988) is computed (via polycor::hetcor()).

Note: logical input is treated as a 0-1 factor variable.

If "mcd" (= minimum covariance determinant), the MCD estimator (Rousseeuw and Driessen 1999), a robust covariance estimator, is applied (via MASS::cov.rob()).

If "spearman", the Spearman rank correlation is used (via stats::cor()).

Value

A list with elements:

$S

The (K x K) indicator correlation matrix

$cor_type

The type(s) of indicator correlation computed ( "Pearson", "Polyserial", "Polychoric")

$thre_est

Currently ignored (NULL)

References

Drasgow F (1988). “Polychoric and polyserial correlations.” In Encyclopedia of Statistical Sciences, volume 7, 68–74. John Wiley & Sons Inc, Hoboken.

Rousseeuw PJ, Driessen KV (1999). “A Fast Algorithm for the Minimum Covariance Determinant Estimator.” Technometrics, 41(3), 212–223. doi: 10.1080/00401706.1999.10485670, https://doi.org/10.1080/00401706.1999.10485670.


cSEM

Composite-Based Structural Equation Modeling

v0.4.0
GPL-3
Authors
Manuel E. Rademaker [aut, cre] (<https://orcid.org/0000-0002-8902-3561>), Florian Schuberth [aut] (<https://orcid.org/0000-0002-2110-9086>), Tamara Schamberger [ctb] (<https://orcid.org/0000-0002-7845-784X>), Michael Klesel [ctb] (<https://orcid.org/0000-0002-2884-1819>), Theo K. Dijkstra [ctb], Jörg Henseler [ctb] (<https://orcid.org/0000-0002-9736-3048>)
Initial release
2021-04-09

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.