fit_multinomial function

Fit Multinomial Model on Covariate

Fit Multinomial Model on Covariate

This internal function fits a multinomial regression model for a categorical covariate using the observed data.

fit_multinomial(covparams, obs_data, j, model_fits)

Arguments

  • covparams: List of vectors, where each vector contains information for one parameter used in the modeling of the time-varying covariates (e.g., model statement, family, link function, etc.).
  • obs_data: Data on which the model is fit.
  • j: Integer specifying the index of the covariate.
  • model_fits: Logical scalar indicating whether to return the fitted models. The default is FALSE.

Returns

Fitted model for the covariate at index jj.