factor_loadings.galamm: Extract factor loadings from galamm object

View source: R/factor_loadings.R

factor_loadings.galammR Documentation

Extract factor loadings from galamm object

Description

Extract factor loadings from galamm object

Usage

## S3 method for class 'galamm'
factor_loadings(object)

Arguments

object

Object of class galamm returned from galamm.

Details

This function has been named factor_loadings rather than just loadings to avoid conflict with stats::loadings.

Value

A matrix containing the estimated factor loadings with corresponding standard deviations.

Author(s)

The example for this function comes from PLmixed, with authors Nicholas Rockwood and Minjeong Jeon \insertCiterockwoodEstimatingComplexMeasurement2019galamm.

See Also

fixef.galamm() for fixed regression coefficients, confint.galamm() for confidence intervals, and coef.galamm() for coefficients more generally.

Other details of model fit: VarCorr(), coef.galamm(), confint.galamm(), deviance.galamm(), family.galamm(), fitted.galamm(), fixef(), formula.galamm(), llikAIC(), logLik.galamm(), nobs.galamm(), predict.galamm(), print.VarCorr.galamm(), ranef.galamm(), residuals.galamm(), response(), sigma.galamm(), vcov.galamm()

Examples

# Logistic mixed model with factor loadings, example from PLmixed
data("IRTsim", package = "PLmixed")

# Reduce data size for the example to run faster
IRTsub <- IRTsim[IRTsim$item < 4, ]
IRTsub <- IRTsub[sample(nrow(IRTsub), 300), ]
IRTsub$item <- factor(IRTsub$item)

# Fix loading for first item to 1, and estimate the two others freely
loading_matrix <- matrix(c(1, NA, NA), ncol = 1)

# Estimate model
mod <- galamm(y ~ item + (0 + ability | sid) + (0 + ability | school),
  data = IRTsub, family = binomial, load.var = "item",
  factor = "ability", lambda = loading_matrix
)

# Show estimated factor loadings, with standard errors
factor_loadings(mod)


galamm documentation built on June 8, 2025, 12:42 p.m.