Learn R Programming

galamm (version 0.2.2)

formula.galamm: Extract formula from fitted galamm object

Description

Extract formula from fitted galamm object

Usage

# S3 method for galamm
formula(x, ...)

Value

The formula used to fit the model.

Arguments

x

Object of class galamm returned from galamm.

...

Optional arguments passed on to other methods. Currently not used.

See Also

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

Examples

Run this code
# Mixed response model ------------------------------------------------------

# The mresp dataset contains a mix of binomial and Gaussian responses.

# We need to estimate a factor loading which scales the two response types.
loading_matrix <- matrix(c(1, NA), ncol = 1)

# Define mapping to families.
families <- c(gaussian, binomial)
family_mapping <- ifelse(mresp$itemgroup == "a", 1, 2)


# Fit the model
mod <- galamm(
  formula = y ~ x + (0 + level | id),
  data = mresp,
  family = families,
  family_mapping = family_mapping,
  factor = "level",
  load.var = "itemgroup",
  lambda = loading_matrix
)

# Formula
formula(mod)

Run the code above in your browser using DataLab