1

I'm struggling to remove a handful out outliers from my glmer model in R.

Here's my model

Model2 <- glmer(OccupiedUnoccupied ~ log(Nearest_Conifer_Distance) + (1|Stand_Type), family="binomial", data=MicrohabitatLogs)

And here's my code to produce the F vs. R plot

binnedplot(fitted(Model2), 
           residuals(Model2, type = "response"), 
           nclass = NULL, 
           xlab = "Expected Values", 
           ylab = "Average residual", 
           main = "Binned residual plot, Microhabitat Model 2", 
           cex.pts = 0.8, 
           col.pts = 1, 
           col.int = "gray")

And here's the resulting plot Fitted vs. Residual Plot, Model 2

As you can see there's a handful of points far along the x-axis that are ruining my regression. Any help for identifying these points and removing them from my dataset for the regression?

I've tried the identify function as well, but as I click to identify those points on the far right end of the x-axis, it returns the following error message:

warning: no point within 0.25 inches

Which is obviously not correct. What can I try next?

halfer
  • 19,824
  • 17
  • 99
  • 186
  • It looks like you're fairly new to SO; welcome to the community! If you want great answers quickly, it's best to make your question reproducible. This includes sample data, like the output from `dput(head(dataObject)))`. Check it out: [making R reproducible questions](https://stackoverflow.com/q/5963269). Instead of looking for a point to do something with (like removing it = invalid, unreliable analysis), have you looked at the assumptions of this method? Check out `DHARMa::simulateResuiduals()` or `MVN` for the blocks. Then try to create a training and test set, to test the model. – Kat Jan 26 '22 at 04:33
  • Try `?identify`. – jay.sf Jan 26 '22 at 07:23
  • 1
    Please provide enough code so others can better understand or reproduce the problem. – Community Feb 01 '22 at 15:14
  • 1
    @jay.sf, identify doesn't seem to work for me, I just edited my post to reflect that. Thank you for the suggestion though. – Seth Finkel Feb 01 '22 at 21:04

0 Answers0