R/03_modelformation_factorstart.R

# factorstart <- function(covmat, lambda){
#   browser()
#   # Number of latents:
#   nLat <- ncol(lambda)
#   nObs <- ncol(lambda)
#   
#   # Run EFA:
#   fa <- factanal(covmat = covmat, factors = nLat, rotation = "promax")
#   
#   # Uniqueness:
#   thetaStart <- diag(fa$uniquenesses^2)
#   
#   # loadings:
#   loadings <- as.matrix(fa$loadings)
#   class(loadings) <- "matrix"
#   
#   loadings
#   lambda  
#   
#   
# }

Try the psychonetrics package in your browser

Any scripts or data that you put into this service are public.

psychonetrics documentation built on Oct. 3, 2023, 5:09 p.m.