claycantrell / PartInvShinyUI

MMM Lab Partial Invariance Shiny UI
GNU General Public License v3.0
0 stars 2 forks source link

Add a new page for multidimensional analysis #13

Open YichiZhang2024 opened 2 years ago

YichiZhang2024 commented 2 years ago

Changes for multidimensional analysis:

Assume we have n factors measured by m items.

  1. item weight (weights_item) is a vector with length m.
  2. latent factor weight (weights_latent) is a vector with length n.
  3. Factor mean (alpha_r and alpha_f) is now a vector instead of a single number. Note these two parameters should have the same length (n).
  4. Factor variance (psi_r and psi_f) is now a matrix instead of a single number. Note these two parameters should have the same dimension (n x n).
  5. Factor loadings (lambda_r and lambda_f) are matrices instead of vectors. The dimension of these two parameters is m x n.
  6. Factor intercepts (nu_r and nu_f) are vectors with dimension m x 1.
  7. Uniqueness (Theta_r and Theta_f) are matrices with dimension m x m.

Illustrative example:

lambda_matrix <- matrix(c(.3, .5, 0, 0, 0, 0, 0, .9, .7, .7), ncol = 2, nrow = 5) PartInvMulti_we(propsel = .05, weights_item = c(1/4, 1/4, 1/6, 1/6, 1/6), weights_latent = c(0.5, 0.5), alpha_r = c(0, 0), alpha_f = c(-0.3, 0.1), psi_r = matrix(c(1, 0.5, 0.5, 1), nrow = 2), lambda_r = lambda_matrix, nu_r = c(.225, .025, .010, .240, .125), nu_f = c(.225, -.05, .240, -.025, .125), Theta_r = diag(1, 5), Theta_f = diag(c(1, .95, .80, .75, 1)))