Package 'mulSEM'

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

Help Index


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>.

Author(s)

Mike W.-L. Cheung <[email protected]>, Fei Gu <[email protected]>, Yiu-Fai Yung <[email protected]>

Maintainer: Mike W.-L. Cheung <[email protected]>

References

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

Examples

## 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

Description

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.

Usage

cancorr(X_vars, Y_vars, data=NULL, Cov, numObs,
        model=c("CORR-W", "CORR-L", "COV-W", "COV-L"),
        extraTries=50, ...)

Arguments

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 data is not available.

numObs

A sample size if data is not available.

model

Four models defined in Gu, Yung, and Cheung (2019). CORR and COV refer to the analysis of correlation structure and covariance structure, respectively.

extraTries

This function calls mxTryHard to obtain the parameter estimates and their standard errors. extraTries indicates the number of extra runs. If extraTries=0, mxRun is called.

...

Additional arguments sent to either mxTryHard or mxRun.

Value

A list of output with class CanCor. It stores the model in OpenMx objects. The fitted object is in the slot of mx.fit.

Note

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.

Author(s)

Mike W.-L. Cheung <[email protected]>

References

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

See Also

Thorndike00, sas_ex1


Correlation matrix of a model of motivation

Description

This dataset includes a correlation matrix of 12 variables (n=533) of a model of motivation reported by Chittum, Jones, and Carter (2019).

Usage

data("Chittum19")

Details

A list of data with the following structure:

data

A 12x12 correlation matrix.

n

A sample size.

Source

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

References

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

Examples

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)

Correlation matrix of artificial data

Description

This dataset includes a correlation matrix of the artificial data 9 variables used in Table 1 of Lambert, Wildt, and Durand (1988).

Usage

data("Lambert88")

Details

A 9x9 correlation matrix.

Source

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

References

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

Examples

data(Lambert88)

## Redundancy Analysis
rda(X_vars=paste0("x", 1:5), Y_vars=paste0("y", 1:4), Cov=Lambert88, numObs=100)

Multivariate Principal Component Regression (MPCR)

Description

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.

Usage

mpcr(X_vars, Y_vars, data=NULL, Cov, Means=NULL, numObs, pca=c("COV", "COR"),
     pc_select=NULL, extraTries=50, ...)

Arguments

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 data is not available.

Means

An optional mean vector if data is not available.

numObs

A sample size if data is not available.

pca

Whether the principal component analysis is based unstandardized COV or standardized COR variables.

pc_select

PCs selected in the regression analysis. For example, pc_select=c(1,2) to use the first two PCs in the multiple regression analysis.

extraTries

This function calls mxTryHard to obtain the parameter estimates and their standard errors. extraTries indicates the number of extra runs. If extraTries=0, mxRun is called.

...

Additional arguments sent to either mxTryHard or mxRun.

Value

A list of output with class MPCR. It stores the model in OpenMx objects. The fitted object is in the slot of mx.fit.

Author(s)

Mike W.-L. Cheung <[email protected]>

References

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

See Also

Nimon21


Raw data used in Nimon, Joo, and Bontrager (2021)

Description

This dataset includes the raw data of 13 variables reported by Nimon, Joo, and Bontrager (2021).

Usage

data("Nimon21")

Details

A data frame of 13 variables.

Source

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

References

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

Examples

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 Methods for various Objects

Description

Print method for CanCorr and RDA objects.

Usage

## 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, ...)

Arguments

x

An object returned from the class of either CanCorr, RDA, or MPCR.

digits

Number of digits in printing the matrices. The default is 4.

...

Unused.

Value

No return value, called for side effects

Author(s)

Mike W.-L. Cheung <[email protected]>


Redundancy Analysis

Description

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.

Usage

rda(X_vars, Y_vars, data=NULL, Cov, numObs, extraTries=50, ...)

Arguments

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 data is not available.

numObs

A sample size if data is not available.

extraTries

This function calls mxTryHard to obtain the parameter estimates and their standard errors. extraTries indicates the number of extra runs. If extraTries=0, mxRun is called.

...

Additional arguments sent to either mxTryHard or mxRun.

Value

A list of output with class RDA. It stores the model in OpenMx objects. The fitted object is in the slot of mx.fit.

Author(s)

Mike W.-L. Cheung <[email protected]>

References

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

See Also

Chittum19, sas_ex2


Sample data for canonical correlation analysis from the SAS manual

Description

This dataset includes six variables of fitness club data from the SAS manual.

Usage

data("sas_ex1")

Details

A 20x6 data matrix.

Source

https://documentation.sas.com/doc/en/statcdc/14.2/statug/statug_cancorr_example01.htm

Examples

data(sas_ex1)

## Canonical Correlation Analysis
cancorr(X_vars=c("Weight", "Waist", "Pulse"),
        Y_vars=c("Chins", "Situps", "Jumps"),
        data=sas_ex1)

Sample data for redundancy analysis from the SAS manual

Description

This dataset includes seven variables from the SAS manual.

Usage

data("sas_ex2")

Details

A 10x7 data matrix.

Source

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_transreg_details23.htm

Examples

data(sas_ex2)

## Redundancy Analysis
rda(X_vars=c("x1", "x2", "x3", "x4"),
    Y_vars=c("y1", "y2", "y3"),
    data=sas_ex2)

Correlation matrix of a model of disgust

Description

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).

Usage

data("Thorndike00")

Details

A list of data with the following structure:

data

A 13x13 correlation matrix.

n

A sample size.

Source

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.

References

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

Examples

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)