
Last chance! 50% off unlimited learning
Sale ends in
Computes implied correlations (completely standardized) from Beta matrix, disallowing recursive paths.
getPhi.B(B, lPsi = NULL)
Returns the implied correlation matrix
matrix of regression coefficients (all-y notation). Must only contain non-zero lower-triangular elements, so the first row only includes zeros.
(lesser) matrix of residual correlations. This is not the Psi matrix, but a lesser version ignoring all variances and containing correlations off the diagonal. Can be omitted for no correlations beyond those implied by B.
if (FALSE) {
# mediation model
B <- matrix(c(
c(.00, .00, .00),
c(.10, .00, .00),
c(.20, .30, .00)
), byrow = TRUE, ncol = 3)
Phi <- getPhi.B(B)
# CLPM with residual correlations
B <- matrix(c(
c(.00, .00, .00, .00),
c(.30, .00, .00, .00),
c(.70, .10, .00, .00),
c(.20, .70, .00, .00)
), byrow = TRUE, ncol = 4)
lPsi <- matrix(c(
c(.00, .00, .00, .00),
c(.00, .00, .00, .00),
c(.00, .00, .00, .30),
c(.00, .00, .30, .00)
), byrow = TRUE, ncol = 4)
Phi <- getPhi.B(B, lPsi)
}
Run the code above in your browser using DataLab