Learn R Programming

psychmeta (version 0.2.4)

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)

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

Value

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

References

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

Lawley, D. N. (1943). A note on Karl Pearson<U+2019>s selection formulae. Proceedings of the Royal Society of Edinburgh. Section A. Mathematical and Physical Sciences, 62(1), 28<U+2013>30.

Examples

Run this code
# NOT RUN {
Sigma_i <- matrix(.2, 5, 5)
diag(Sigma_i) <- 1
Sigma_xx_a <- matrix(.4, 2, 2)
diag(Sigma_xx_a) <- .8
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