I want to look for a relashionship between the competition facing a hospital and mortality within the hospital. Assuming that patients in the same hospital may be more correlated than patients in different hospitals, I decided to adopt a mixed model.
I have a data set of more than 150k rows. The number of hospitals is 720
So I consider the hospital to be a random effect variable. I also consider Trimester (=20 modalities, because the study is 5 years of data divided into trimesters) as a random effect variable. The variables: Hospital_status (The status of the hospital) and Hospital_caseload(number of patients treated by the hospital) are related to the hospital and the other variables are related to the patients.
This is my model:
MultModel<-glmer(Death30~HHI+age+Sex++Emmergency+neoadjTrt+
denutrition+Charlson+Right colectomy+
colectomie_transverse+Total.colectomy+Hospital_status
Hospital_caseload+(1|Trimester)+(1|Hospital_ID),
data =data,family=binomial(link="logit"),nAGQ = 0)
However, I have some doubt about rightness of the model. What could be the problems if I don't take into account of hospital effect and fit the model below?
MultModel<-glmer(Death30~HHI+age+Sex++Emmergency+neoadjTrt+
denutrition+Charlson+Right colectomy+
colectomie_transverse+Total.colectomy+Hospital_status
Hospital_caseload+(1|Trimester),
data =data,family=binomial(link="logit"),nAGQ = 0)
But if take into account hospital effect, could it be a problem to put in the model the other variables related to hospital (that is Hospital_status and Hospital_caseload)
As a last question, does nAGQ=0 give a good model, I use it because of the slowness of R to run the model. What value should I give to nAGQ to have the most accurate and fastest model?What other tricks can I use to speed up the execution of the model without affecting the quality?
ss <- getME(MultModel, c("theta", "fixef")); restart <- update(MultModel, start=ss, nAGQ=1); summary(restart). But the model stil fail to converge with this warning message:convergence code: 0 Model failed to converge with max|grad| = 0.0338291 (tol = 0.001, component 1)– Seydou GORO Sep 16 '20 at 14:00nAGQ=0, there is no convergence problem. I tried to refit the model with nAGQ=1 using the value extracted from the first model as you recommended. So the model did not converge withnAGQ=1. I am wondering if this is not due to the unbalanced structure of my data, because the observation within the hospitals varies between 5 and more than 1200 – Seydou GORO Sep 16 '20 at 14:58maxfuninlmerControlto higher values – Robert Long Sep 16 '20 at 15:04glmerControlinstead oflmerControl? – Seydou GORO Sep 16 '20 at 15:20glmerControl. Also why do you fit random intercepts forTrimesterand what happens if you don't? – Robert Long Sep 16 '20 at 17:36