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?