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] , Fei Gu [ctb] , Yiu-Fai Yung [ctb] |
Maintainer: | Mike Cheung <[email protected]> |
License: | GPL (>=2) |
Version: | 1.0 |
Built: | 2024-11-01 03:54:09 UTC |
Source: | https://github.com/mikewlcheung/mulsem |
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>.
Mike W.-L. Cheung <[email protected]>, Fei Gu <[email protected]>, Yiu-Fai Yung <[email protected]>
Maintainer: 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. https://doi.org/10.1111/bmsp.12301
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. https://doi.org/10.1080/00273171.2018.1512847
Gu, F., Yung, Y.-F., Cheung, M. W.-L. Joo, B.-K., & Nimon, K. (2022). Statistical inference in redundancy analysis: A direct covariance structure modeling approach. Multivariate Behavioral Research, 58(5), 877-893. https://doi.org/10.1080/00273171.2022.2141675
## Canonical Correlation Analysis cancorr(X_vars=c("Weight", "Waist", "Pulse"), Y_vars=c("Chins", "Situps", "Jumps"), data=sas_ex1) ## Redundancy Analysis rda(X_vars=c("x1", "x2", "x3", "x4"), Y_vars=c("y1", "y2", "y3"), data=sas_ex2) ## 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)
## Canonical Correlation Analysis cancorr(X_vars=c("Weight", "Waist", "Pulse"), Y_vars=c("Chins", "Situps", "Jumps"), data=sas_ex1) ## Redundancy Analysis rda(X_vars=c("x1", "x2", "x3", "x4"), Y_vars=c("y1", "y2", "y3"), data=sas_ex2) ## 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)
It conducts a 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 on the estimates.
cancorr(X_vars, Y_vars, data=NULL, Cov, numObs, model=c("CORR-W", "CORR-L", "COV-W", "COV-L"), extraTries=50, ...)
cancorr(X_vars, Y_vars, data=NULL, Cov, numObs, 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 of raw data. |
Cov |
A covariance or correlation matrix if |
numObs |
A sample size if |
model |
Four models defined in Gu, Yung, and Cheung
(2019). |
extraTries |
This function calls |
... |
A list of output with class CanCor
. It stores the model in
OpenMx objects. The fitted object is in the slot of mx.fit
.
cancorr
expects that there are equal or more number of
variables in Y_vars
. If there are fewer variables 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. https://doi.org/10.1080/00273171.2018.1512847
This dataset includes a correlation matrix of 12 variables (n=533) of a model of motivation reported by Chittum, Jones, and Carter (2019).
data("Chittum19")
data("Chittum19")
A list of data with the following structure:
A 12x12 correlation matrix.
A sample size.
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. https://doi.org/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. https://doi.org/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 the artificial data 9 variables used in Table 1 of Lambert, Wildt, and Durand (1988).
data("Lambert88")
data("Lambert88")
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. https://doi.org/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. https://doi.org/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)
It conducts a multivariate principal component regression 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 on the estimates.
mpcr(X_vars, Y_vars, data=NULL, Cov, Means=NULL, numObs, pca=c("COV", "COR"), pc_select=NULL, extraTries=50, ...)
mpcr(X_vars, Y_vars, data=NULL, Cov, Means=NULL, numObs, 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 of raw data. |
Cov |
A covariance or correlation matrix if |
Means |
An optional mean vector if |
numObs |
A sample size if |
pca |
Whether the principal component analysis is based unstandardized |
pc_select |
PCs selected in the regression analysis. For example,
|
extraTries |
This function calls |
... |
A list of output with class MPCR
. It stores the model in
OpenMx objects. The fitted object is in the slot of 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. https://doi.org/10.1111/bmsp.12301
This dataset includes the raw data of 13 variables reported by Nimon, Joo, and Bontrager (2021).
data("Nimon21")
data("Nimon21")
A data frame of 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. https://doi.org/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. https://doi.org/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. https://doi.org/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
and RDA
objects.
## S3 method for class 'CanCorr' print(x, digits=4, ...) ## S3 method for class 'RDA' print(x, digits=4, ...) ## S3 method for class 'MPCR' print(x, digits=4, ...)
## S3 method for class 'CanCorr' print(x, digits=4, ...) ## S3 method for class 'RDA' print(x, digits=4, ...) ## S3 method for class 'MPCR' print(x, digits=4, ...)
x |
An object returned from the class of either |
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]>
It conducts a 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 on the standardized estimates.
rda(X_vars, Y_vars, data=NULL, Cov, numObs, extraTries=50, ...)
rda(X_vars, Y_vars, data=NULL, Cov, numObs, 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 of raw data. |
Cov |
A covariance or correlation matrix if |
numObs |
A sample size if |
extraTries |
This function calls |
... |
A list of output with class RDA
. It stores the model in
OpenMx objects. The fitted object is in the slot of 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. https://doi.org/10.1080/00273171.2022.2141675
This dataset includes six variables of fitness club data from the SAS manual.
data("sas_ex1")
data("sas_ex1")
A 20x6 data matrix.
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.
data("sas_ex2")
data("sas_ex2")
A 10x7 data matrix.
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 Disguest Emotion Scale and eight subscales (x1 to x8) of the Disgust Scale reported by Thorndike (2000, p. 238).
data("Thorndike00")
data("Thorndike00")
A list of data with the following structure:
A 13x13 correlation matrix.
A sample size.
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. https://doi.org/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)