correct_means_mvrr: Multivariate select/correction for vectors of means

View source: R/correct_mvrr.R

correct_means_mvrrR Documentation

Multivariate select/correction for vectors of means

Description

Correct (or select upon) a vector of means using principles from the Pearson-Aitken-Lawley multivariate selection theorem.

Usage

correct_means_mvrr(
  Sigma,
  means_i = rep(0, ncol(Sigma)),
  means_x_a,
  x_col,
  y_col = NULL,
  var_names = NULL
)

Arguments

Sigma

The complete covariance matrix to be used to manipulate means: This matrix may be entirely unrestricted or entirely range restricted, as the regression weights estimated from this matrix are expected to be invariant to the effects of selection.

means_i

The complete range-restricted (unrestricted) vector of means to be corrected (selected upon).

means_x_a

The vector of unrestricted (range-restricted) means of selection variables

x_col

The row/column indices of the variables in Sigma that correspond, in order, to the variables in means_x_a

y_col

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

var_names

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

Value

A vector of means that has been manipulated 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–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

Sigma <- diag(.5, 4)
Sigma[lower.tri(Sigma)] <- c(.2, .3, .4, .3, .4, .4)
Sigma <- Sigma + t(Sigma)
diag(Sigma) <- 1
correct_means_mvrr(Sigma = Sigma, means_i = c(.3, .3, .1, .1),
means_x_a = c(-.1, -.1), x_col = 1:2)

psychmeta documentation built on June 22, 2024, 6:52 p.m.