0
$\begingroup$

I am very new to R and I have a problem with the diagnostics of my models...can anyone help me please?

I have run my model:

Modell_ia8 <- glmer(vote~edu1 + age1 + female + eink1 + scltrst + poltrst + links1 +
                    links1:edu1 + rechts1 + rechts1:edu1 + (1|country),
                    family = binomial(link = "logit"), data = all)

Then I came across the DHARMa package and did this:

simulationOutput1 <- simulateResiduals(fittedModel = Modell_ia8,n=100)
plot(simulationOutput1)

which gives me this: enter image description here

I guess the QQ Plot looks good but I do not understand the residual plot at all:

  1. Why is it all black?
  2. What do the read lines in the middle and at 0 and 1 mean?
$\endgroup$
  • $\begingroup$ The plot is just cluttered with residuals. Try running it with a small subset of your data to see what is usually looks like. Also: The answer is given in the title of the plot. The dashed line at 0.50 more or less follows the solid line, so there is no trend in residual variance (which is good). $\endgroup$ – Frans Rodenburg May 27 at 3:54
  • $\begingroup$ Thank you for your answer! But what do the red points at 0 and 1 mean? $\endgroup$ – Blerta Salihi May 28 at 14:11
  • $\begingroup$ According to the documentation (rdocumentation.org/packages/DHARMa/versions/0.2.4/topics/…), these are marked 'outliers', although I would be surprised not to see any supposed outliers at such a sample size. $\endgroup$ – Frans Rodenburg May 29 at 12:16
1
$\begingroup$

I'm the developer of the DHARMa package. Frans Rodenburg is right. Just to summarise

  • The plot to the right is clustered because you have so many data = many residuals. Ff you want to reduce the number of residuals, you can take a subset of the data, or aggregate residuals via the recalculateResiduals function.

  • Given your large number of data points, some outliers are expected. The left plot tells you that you don not have more outliers than expected (outlier test n.s.)

p.s.: you will get a faster answer if you post DHARMa-specific questions here.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.