florianhartig / DHARMa

Diagnostics for HierArchical Regession Models
http://florianhartig.github.io/DHARMa/
208 stars 22 forks source link

Interpreting DHARMa output #374

Open anaverahrami opened 1 year ago

anaverahrami commented 1 year ago

Hi folks,

I'm working with a binomial, logistic regression model using the glmer function from lme4. I'm interested in looking at the diagnostics of my top model and have run code using DHARMa to look at my residuals with one of my factor variables (HabitatType.f) since I know the package is useful for GLMMs. At first, I ran my code as the below with refit = F and produced the below outputs: res <- simulateResiduals(mod.top, plot=T, refit = F) par(mfrow = c(1,3)) plotResiduals(res, diel_sub$HabitatType.f) testDispersion(res) testZeroInflation(res)

mod top_withoutBootstrap_diagnostics mod top_withoutBootstrap_diagnostics2

But because I am using a random effect of "site", I chose to change refit to T to conduct bootstrapping and got the following outputs: mod top_withBootstrap_diagnostics mod top_withBootstrap_diagnostics2

I don't have any experience interpreting these plots for GLMMs and was hoping someone could help me with the interpretation. I see that when I use bootstrapping, my QQplot line is much closer to the expected line, but the p-values for the KS test, Dispersion test, and Outlier test are all significant whereas without bootstrapping, my QQplot line is more varied from the expected and only the outlier test and KS test have significant p-values.

Also as I mentioned, I am running these residuals against my factor variable of HabitatType which has three levels. But for some reason, both with and without bootstrapping, my figure for the Levene Test for homogeneity of variance is showing a 4th level (unlabeled) and I can't seem to figure out why this 4th level is being produced on the plots.

Any guidance you can provide would be much appreciated and thanks in advance!

florianhartig commented 1 year ago

Hi, sorry for the late reply - could you tell me which model you are fitting as well as roughly what the data size / dimensions are?

F