Learn R Programming

mulSEM (version 1.2)

mpcr: Multivariate Principal Component Regression (MPCR)

Description

Conduct multivariate principal component regression

Usage

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

Value

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

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 containing raw data. If NULL, Cov and numObs must be provided.

Cov

A covariance or correlation matrix. Required when data is NULL.

Means

An optional mean vector. Can be provided when data is NULL.

numObs

A sample size. Required when data is NULL.

pca

Whether principal component analysis is based on 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 OpenMx::mxTryHard() to obtain parameter estimates and their standard errors. extraTries is the number of extra runs. If extraTries=0, OpenMx::mxRun() is called.

...

Additional arguments passed to either OpenMx::mxTryHard() or OpenMx::mxRun().

Author

Mike W.-L. Cheung mikewlcheung@nus.edu.sg

Details

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.

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. tools:::Rd_expr_doi("10.1111/bmsp.12301")

See Also

Nimon21

Examples

Run this code
# \donttest{
## 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)
# }

Run the code above in your browser using DataLab