getPhi.B: getPhi.B

View source: R/helperFunctions.R

getPhi.BR Documentation

getPhi.B

Description

Computes implied correlations (completely standardized) from Beta matrix, disallowing recursive paths.

Usage

getPhi.B(B, lPsi = NULL)

Arguments

B

matrix of regression coefficients (all-y notation). Must only contain non-zero lower-triangular elements, so the first row only includes zeros.

lPsi

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

Value

Returns the implied correlation matrix

Examples

## Not run: 
# 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)

## End(Not run)

semPower documentation built on Nov. 15, 2023, 1:08 a.m.