This function is used to fit a random effect logistic model of the form:
$$\text{logit}(P(Y_{ij} = 1 \mid \alpha_i, \mathbf{Z}_{ij})) = \mu + \alpha_i + \mathbf{Z}_{ij}^\top \boldsymbol{\beta},$$
where \(Y_{ij}\) is the binary outcome for individual \(j\) in provider \(i\),
\(\mu\) is the overall intercept, \(\alpha_i\) is the random effect for provider \(i\),
\(\mathbf{Z}_{ij}\) are the covariates, and \(\boldsymbol\beta\) is the vector of coefficients for the covariates.
The model is fitted by overloading the glmer function from the lme4 package.
Three different input formats are accepted:
a formula and dataset, where the formula is of the form response ~ covariates + (1 | provider), with provider representing the provider identifier;
a dataset along with the column names of the response, covariates, and provider identifier;
or the outcome vector \(\boldsymbol{Y}\), the covariate matrix or data frame \(\mathbf{Z}\), and the provider identifier vector.
In addition to these input formats, all arguments from the glmer function can be modified via ...,
allowing for customization of model fitting options.
If issues arise during model fitting, consider using the data_check function to perform a data quality check,
which can help identify missing values, low variation in covariates, high-pairwise correlation, and multicollinearity.
For datasets with missing values, this function automatically removes observations (rows) with any missing values before fitting the model.