I used glmmTMB to fit a model with beta distributed errors, zero inflation, several nested random effects and temporal correlation. I then used the diagnostic plots available in DHARMa. My residual vs predicted plot looks like this The plot is (I think) similar to the one shown in the other packages section of the DHARMa package vignette. What is the meaning of the dashed line? Also, are all three residual lines overlapping at 0.50?
1 Answer
I just found that the question has been posed before and answered here
Quoting Florian Hartig's response:
Hi, this is expected behavior - the default of the plot function is to do the quantile regression for n <= 2000, and for larger datasets a nonparametric smoother, because the quantile regressions can take a long time to calculate. You can overwrite this if you want. Example
library(DHARMa)
testData = createData(sampleSize = 2200, family = poisson(), randomEffectVariance = 0, numGroups = 5) fittedModel <- glm(observedResponse ~ Environment1, family = "poisson", data = testData) simulationOutput <- simulateResiduals(fittedModel = fittedModel)
plot(simulationOutput) # default switches to quanreg = F for n > 2000 plot(simulationOutput, quantreg = T) # overrule default
side note: with so many data points, and binomial, it would be useful to think about if you can group your data in some way, using the new recalculateResiduals() function in DHARMa 0.2.0
-
$\begingroup$ I am not sure if this should be an answer or an update of the original post. Please advise. $\endgroup$ Commented Feb 13, 2020 at 8:32
-
1$\begingroup$ The answer is still good, just an add-on: there is a new DHARMa version with a more efficient quantile regression available for beta testing, see twitter.com/florianhartig/status/1227291704371269632 $\endgroup$ Commented Feb 13, 2020 at 18:05