R/stats_functions.R
fit_lmer_model.RdThis function attempts to fit a linear mixed-effects model with a given formula string using the `lme4::lmer` function. It includes error handling to gracefully return `NULL` if the model cannot be fit.
fit_lmer_model(formula_str, data)A fitted `lmerMod` object if successful, otherwise `NULL`.