| Title: | Some Multivariate Analyses using Structural Equation Modeling |
|---|---|
| Description: | A set of functions for some multivariate analyses utilizing a structural equation modeling (SEM) approach through the 'OpenMx' package. These analyses include canonical correlation analysis (CANCORR), redundancy analysis (RDA), and multivariate principal component regression (MPCR). It implements procedures discussed in Gu and Cheung (2023) <doi:10.1111/bmsp.12301>, Gu, Yung, and Cheung (2019) <doi:10.1080/00273171.2018.1512847>, and Gu et al. (2023) <doi:10.1080/00273171.2022.2141675>. |
| Authors: | Mike Cheung [aut, cre] (ORCID: <https://orcid.org/0000-0003-0113-0758>), Fei Gu [ctb] (ORCID: <https://orcid.org/0000-0002-1753-8398>), Yiu-Fai Yung [ctb] |
| Maintainer: | Mike Cheung <[email protected]> |
| License: | GPL (>=2) |
| Version: | 1.2 |
| Built: | 2026-05-17 08:37:27 UTC |
| Source: | https://github.com/mikewlcheung/mulsem |
This function conducts canonical correlation analysis using the OpenMx package. Missing data are handled with the full information maximum likelihood method when raw data are available. It provides standard errors for the estimates.
cancorr( X_vars, Y_vars, data = NULL, Cov = NULL, numObs = NULL, model = c("CORR-W", "CORR-L", "COV-W", "COV-L"), extraTries = 50, ... )cancorr( X_vars, Y_vars, data = NULL, Cov = NULL, numObs = NULL, model = c("CORR-W", "CORR-L", "COV-W", "COV-L"), extraTries = 50, ... )
X_vars |
A vector of characters of the X variables. |
Y_vars |
A vector of characters of the Y variables. |
data |
A data frame containing raw data. If NULL, |
Cov |
A covariance or correlation matrix. Required when |
numObs |
A sample size. Required when |
model |
Four models defined in Gu, Yung, and Cheung (2019).
|
extraTries |
This function calls |
... |
Additional arguments passed to either
|
A list with class CanCorr. It stores the model in OpenMx
objects. The fitted object is stored in mx.fit.
cancorr expects the number of variables in Y_vars to be
equal to or greater than that in X_vars. If there are fewer in
Y_vars, you may swap between X_vars and Y_vars.
Mike W.-L. Cheung [email protected]
Gu, F., Yung, Y.-F., & Cheung, M. W.-L. (2019). Four covariance structure models for canonical correlation analysis: A COSAN modeling approach. Multivariate Behavioral Research, 54(2), 192-223. doi:10.1080/00273171.2018.1512847
## Canonical Correlation Analysis cancorr(X_vars=c("Weight", "Waist", "Pulse"), Y_vars=c("Chins", "Situps", "Jumps"), data=sas_ex1)## Canonical Correlation Analysis cancorr(X_vars=c("Weight", "Waist", "Pulse"), Y_vars=c("Chins", "Situps", "Jumps"), data=sas_ex1)
This dataset includes a correlation matrix of 12 variables (n=533) of a model of motivation reported by Chittum, Jones, and Carter (2019).
Chittum19Chittum19
A list with the following components:
A 12x12 correlation matrix.
A sample size (533).
Chittum, J. R., Jones, B. D., & Carter, D. M. (2019). A person-centered investigation of patterns in college students' perceptions of motivation in a course. Learning and Individual Differences, 69, 94-107. doi:10.1016/j.lindif.2018.11.007
Gu, F., Yung, Y.-F., Cheung, M. W.-L., Joo, B.-K., & Nimon, K. (2023). Statistical inference in redundancy analysis: A direct covariance structure modeling approach. Multivariate Behavioral Research, 58(5), 877-893. doi:10.1080/00273171.2022.2141675
data(Chittum19) ## Redundancy Analysis rda(X_vars=c("Empowerment", "Usefulness", "Success", "Interest", "Caring"), Y_vars=c("Final_Exam", "Learning", "Course_Rating", "Instr_Rating", "Effort", "Cog_Engage", "Cost"), Cov=Chittum19$data, numObs=Chittum19$n)data(Chittum19) ## Redundancy Analysis rda(X_vars=c("Empowerment", "Usefulness", "Success", "Interest", "Caring"), Y_vars=c("Final_Exam", "Learning", "Course_Rating", "Instr_Rating", "Effort", "Cog_Engage", "Cost"), Cov=Chittum19$data, numObs=Chittum19$n)
This dataset includes a correlation matrix of nine artificial variables used in Table 1 of Lambert, Wildt, and Durand (1988).
Lambert88Lambert88
A 9x9 correlation matrix.
Lambert, Z. V., Wildt, A. R., & Durand, R. M. (1988). Redundancy analysis: An alternative to canonical correlation and multivariate multiple regression in exploring interset associations. Psychological Bulletin, 104(2), 282-289. doi:10.1037/0033-2909.104.2.282
Gu, F., Yung, Y.-F., Cheung, M. W.-L., Joo, B.-K., & Nimon, K. (2023). Statistical inference in redundancy analysis: A direct covariance structure modeling approach. Multivariate Behavioral Research, 58(5), 877-893. doi:10.1080/00273171.2022.2141675
data(Lambert88) ## Redundancy Analysis rda(X_vars=paste0("x", 1:5), Y_vars=paste0("y", 1:4), Cov=Lambert88, numObs=100)data(Lambert88) ## Redundancy Analysis rda(X_vars=paste0("x", 1:5), Y_vars=paste0("y", 1:4), Cov=Lambert88, numObs=100)
Conduct multivariate principal component regression
mpcr( X_vars, Y_vars, data = NULL, Cov = NULL, Means = NULL, numObs = NULL, pca = c("COV", "COR"), pc_select = NULL, extraTries = 50, ... )mpcr( X_vars, Y_vars, data = NULL, Cov = NULL, Means = NULL, numObs = NULL, pca = c("COV", "COR"), pc_select = NULL, extraTries = 50, ... )
X_vars |
A vector of characters of the X variables. |
Y_vars |
A vector of characters of the Y variables. |
data |
A data frame containing raw data. If NULL, |
Cov |
A covariance or correlation matrix. Required when |
Means |
An optional mean vector. Can be provided when |
numObs |
A sample size. Required when |
pca |
Whether principal component analysis is based on
unstandardized ( |
pc_select |
PCs selected in the regression analysis. For example,
|
extraTries |
This function calls |
... |
Additional arguments passed to either
|
This function conducts multivariate principal component regression using the OpenMx package. Missing data are handled with the full information maximum likelihood method when raw data are available. It provides standard errors for the estimates.
A list with class MPCR. It stores the model in OpenMx
objects. The fitted object is stored in mx.fit.
Mike W.-L. Cheung [email protected]
Gu, F., & Cheung, M. W.-L. (2023). A model-based approach to multivariate principal component regression: Selection of principal components and standard error estimates for unstandardized regression coefficients. British Journal of Mathematical and Statistical Psychology, 76(3), 605-622. doi:10.1111/bmsp.12301
## Multivariate Principal Component Regression mpcr(X_vars=c("AU", "CC", "CL", "CO", "DF", "FB", "GR", "MW"), Y_vars=c("IDE", "IEE", "IOCB", "IPR", "ITS"), pca="COR", pc_select=1, data=Nimon21)## Multivariate Principal Component Regression mpcr(X_vars=c("AU", "CC", "CL", "CO", "DF", "FB", "GR", "MW"), Y_vars=c("IDE", "IEE", "IOCB", "IPR", "ITS"), pca="COR", pc_select=1, data=Nimon21)
This dataset includes the raw data of 13 variables reported by Nimon, Joo, and Bontrager (2021).
Nimon21Nimon21
A data frame with 13 variables.
Nimon, K., Joo, B.-K. (Brian), & Bontrager, M. (2021). Work cognitions and work intentions: A canonical correlation study. Human Resource Development International, 24(1), 65-91. doi:10.1080/13678868.2020.1775038
Gu, F., & Cheung, M. W.-L. (2023). A Model-based approach to multivariate principal component regression: Selection of principal components and standard error estimates for unstandardized regression coefficients. British Journal of Mathematical and Statistical Psychology, 76(3), 605-622. doi:10.1111/bmsp.12301
Gu, F., Yung, Y.-F., Cheung, M. W.-L., Joo, B.-K., & Nimon, K. (2023). Statistical inference in redundancy analysis: A direct covariance structure modeling approach. Multivariate Behavioral Research, 58(5), 877-893. doi:10.1080/00273171.2022.2141675
data(Nimon21) ## Redundancy Analysis rda(X_vars=c("AU", "CC", "CL", "CO", "DF", "FB", "GR", "MW"), Y_vars=c("IDE", "IEE", "IOCB", "IPR", "ITS"), data=Nimon21) ## Multivariate Principal Component Regression mpcr(X_vars=c("AU", "CC", "CL", "CO", "DF", "FB", "GR", "MW"), Y_vars=c("IDE", "IEE", "IOCB", "IPR", "ITS"), pca="COR", pc_select=1, data=Nimon21)data(Nimon21) ## Redundancy Analysis rda(X_vars=c("AU", "CC", "CL", "CO", "DF", "FB", "GR", "MW"), Y_vars=c("IDE", "IEE", "IOCB", "IPR", "ITS"), data=Nimon21) ## Multivariate Principal Component Regression mpcr(X_vars=c("AU", "CC", "CL", "CO", "DF", "FB", "GR", "MW"), Y_vars=c("IDE", "IEE", "IOCB", "IPR", "ITS"), pca="COR", pc_select=1, data=Nimon21)
Print method for CanCorr objects.
## S3 method for class 'CanCorr' print(x, digits = 4, ...)## S3 method for class 'CanCorr' print(x, digits = 4, ...)
x |
An object returned from the class of |
digits |
Number of digits in printing the matrices. The default is 4. |
... |
Unused. |
No return value, called for side effects
Mike W.-L. Cheung [email protected]
Print method for MPCR objects.
## S3 method for class 'MPCR' print(x, digits = 4, ...)## S3 method for class 'MPCR' print(x, digits = 4, ...)
x |
An object returned from the class of |
digits |
Number of digits in printing the matrices. The default is 4. |
... |
Unused. |
No return value, called for side effects
Mike W.-L. Cheung [email protected]
Print method for RDA objects.
## S3 method for class 'RDA' print(x, digits = 4, ...)## S3 method for class 'RDA' print(x, digits = 4, ...)
x |
An object returned from the class of |
digits |
Number of digits in printing the matrices. The default is 4. |
... |
Unused. |
No return value, called for side effects
Mike W.-L. Cheung [email protected]
This function conducts redundancy analysis using the OpenMx package. Missing data are handled with the full information maximum likelihood method when raw data are available. It provides standard errors for the standardized estimates.
rda( X_vars, Y_vars, data = NULL, Cov = NULL, numObs = NULL, extraTries = 50, ... )rda( X_vars, Y_vars, data = NULL, Cov = NULL, numObs = NULL, extraTries = 50, ... )
X_vars |
A vector of characters of the X variables. |
Y_vars |
A vector of characters of the Y variables. |
data |
A data frame containing raw data. If NULL, |
Cov |
A covariance or correlation matrix. Required when |
numObs |
A sample size. Required when |
extraTries |
This function calls |
... |
Additional arguments passed to either
|
A list with class RDA. It stores the model in OpenMx
objects. The fitted object is stored in mx.fit.
Mike W.-L. Cheung [email protected]
Gu, F., Yung, Y.-F., Cheung, M. W.-L., Joo, B.-K., & Nimon, K. (2023). Statistical inference in redundancy analysis: A direct covariance structure modeling approach. Multivariate Behavioral Research, 58(5), 877-893. doi:10.1080/00273171.2022.2141675
## Redundancy Analysis rda(X_vars=c("x1", "x2", "x3", "x4"), Y_vars=c("y1", "y2", "y3"), data=sas_ex2)## Redundancy Analysis rda(X_vars=c("x1", "x2", "x3", "x4"), Y_vars=c("y1", "y2", "y3"), data=sas_ex2)
This dataset includes six variables of fitness club data from the SAS manual.
sas_ex1sas_ex1
A data frame with 20 rows and 6 variables:
Weight measurement
Waist measurement
Pulse measurement
Number of chin-ups
Number of sit-ups
Number of jumps
https://documentation.sas.com/doc/en/statcdc/14.2/statug/statug_cancorr_example01.htm
data(sas_ex1) ## Canonical Correlation Analysis cancorr(X_vars=c("Weight", "Waist", "Pulse"), Y_vars=c("Chins", "Situps", "Jumps"), data=sas_ex1)data(sas_ex1) ## Canonical Correlation Analysis cancorr(X_vars=c("Weight", "Waist", "Pulse"), Y_vars=c("Chins", "Situps", "Jumps"), data=sas_ex1)
This dataset includes seven variables from the SAS manual.
sas_ex2sas_ex2
A matrix with 10 rows and 7 columns:
Y variables
X variables
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_transreg_details23.htm
data(sas_ex2) ## Redundancy Analysis rda(X_vars=c("x1", "x2", "x3", "x4"), Y_vars=c("y1", "y2", "y3"), data=sas_ex2)data(sas_ex2) ## Redundancy Analysis rda(X_vars=c("x1", "x2", "x3", "x4"), Y_vars=c("y1", "y2", "y3"), data=sas_ex2)
This dataset includes a correlation matrix of 13 variables (n=679) between five subscales (y1 to y5) of the Disgust Emotion Scale and eight subscales (x1 to x8) of the Disgust Scale reported by Thorndike (2000, p. 238).
Thorndike00Thorndike00
A list with the following components:
A 13x13 correlation matrix.
A sample size (679).
Thorndike, R. M. (2000). Canonical correlation analysis. In H. E. A. Tinsley & S. D. Brown (Eds.), Handbook of applied multivariate statistics and mathematical modeling (pp. 237-263). San Diego, CA: Academic Press.
Gu, F., Yung, Y.-F., & Cheung, M. W.-L. (2019). Four covariance structure models for canonical correlation analysis: A COSAN modeling approach. Multivariate Behavioral Research, 54(2), 192-223. doi:10.1080/00273171.2018.1512847
data(Thorndike00) ## Canonical Correlation Analysis ## Note. We swap the X_vars and Y_vars because cancorr() expects that ## X_vars cannot have more variables than Y_vars. cancorr(X_vars=c("y1", "y2", "y3", "y4", "y5"), Y_vars=c("x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"), Cov=Thorndike00$data, numObs=Thorndike00$n)data(Thorndike00) ## Canonical Correlation Analysis ## Note. We swap the X_vars and Y_vars because cancorr() expects that ## X_vars cannot have more variables than Y_vars. cancorr(X_vars=c("y1", "y2", "y3", "y4", "y5"), Y_vars=c("x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"), Cov=Thorndike00$data, numObs=Thorndike00$n)