Learn R Programming

psychmeta (version 2.7.0)

correct_matrix_mvrr: Multivariate select/correction for covariance matrices

Description

Correct (or select upon) a covariance matrix using the Pearson-Aitken-Lawley multivariate selection theorem.

Usage

correct_matrix_mvrr(
  Sigma_i,
  Sigma_xx_a,
  x_col,
  y_col = NULL,
  standardize = FALSE,
  var_names = NULL
)

Value

A matrix that has been manipulated by the multivariate range-restriction formula.

Arguments

Sigma_i

The complete range-restricted (unrestricted) covariance matrix to be corrected (selected upon).

Sigma_xx_a

The matrix of unrestricted (range-restricted) covariances among of selection variables.

x_col

The row/column indices of the variables in Sigma_i that correspond, in order, to the variables in Sigma_xx_a.

y_col

Optional: The variables in Sigma_i not listed in x_col that are to be manipulated by the multivariate range-restriction formula.

standardize

Should the function's output matrix be returned in standardized form (TRUE) or in unstandardized form (FALSE; the default).

var_names

Optional vector of names for the variables in Sigma_i, in order of appearance in the matrix.

References

Aitken, A. C. (1934). Note on selection from a multivariate normal population. Proceedings of the Edinburgh Mathematical Society (Series 2), 4(2), 106–110.

Lawley, D. N. (1943). A note on Karl Pearson’s selection formulae. Proceedings of the Royal Society of Edinburgh. Section A. Mathematical and Physical Sciences, 62(1), 28–30.

Examples

Run this code
Sigma_i <- reshape_vec2mat(cov = .2, var = .8, order = 4)
Sigma_xx_a <- reshape_vec2mat(cov = .5, order = 2)
correct_matrix_mvrr(Sigma_i = Sigma_i, Sigma_xx_a = Sigma_xx_a, x_col = 1:2, standardize = TRUE)

Run the code above in your browser using DataLab