Dataset
I am working on a dataset collected from more than 20 hospitals. I used the glmer command to estimate a mixed-effects logistic regression model with the following as patient-level predictors:
- age (patient's age; a continuous variable),
- cci (Charlson Comorbidity Index; a continuous variable),
- sex (patient's sex; man vs. woman),
- race (patient's race; Asian vs. Black vs. South Asian vs. White), and
- htn (has hypertension vs. no hypertension).
I used the hospital variable (the hospital that recruited patients) to estimate the random intercept.
Problem
My code for mixed-model (worked very smoothly):
mixed_died30in <- glmer(died30in ~ age + cci + sex + race + htn + infx_source + (1 | hospital), data = passem, family = binomial, control = glmerControl(optimizer = "Nelder_Mead"), nAGQ = 10)
Then I used the mfp command:
mfp_died30in <- mfp(glmer(died30in ~ fp(age, df = 4, select = 0.05) + fp(cci, df = 4, select = 0.05) + sex + race + htn + infx_source + (1 | hospital), family = binomial, data = passem, control = glmerControl(optimizer = "Nelder_Mead"), nAGQ = 10))
The following error appeared:
Error in fixed.only && random.only : invalid 'x' type in 'x && y'
In addition: Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model is nearly unidentifiable: large eigenvalue ratio
- Rescale variables?
Questions
- Does the
mfpcommand from the mfp package in R support mixed-effect models? - Is (are) there any problem(s) in my code?
is.numeric); I rescaled these variable and the warning still apearing – Abo7aneen Mar 03 '23 at 00:00Warningmessage is actually fromglmer()rather thanmfp(): see https://stats.stackexchange.com/q/412185/16974 and https://stats.stackexchange.com/a/231721/16974 – James Stanley Mar 04 '23 at 00:31lme4package) and for that example he suggests there might be complete separation occurring. – James Stanley Mar 04 '23 at 00:32mfp()might be incompatible withglmer(), sincemfp()essentially wraps around the underlying model estimation function...[continued] – James Stanley Mar 04 '23 at 00:35