atyre2 / NRES803

Other
0 stars 8 forks source link

fix whacky smooths problem in check assumptions #15

Open atyre2 opened 2 years ago

atyre2 commented 2 years ago

When there are few unique values on the x axis, the smooths in the standardized residuals and scale location plots get bizarre and unhelpful. Detect this condition and do something about it.

library(NRES803data)
RIKZ_model.2 = lm(Richness ~ week, data = RIKZ)
check_assumptions(RIKZ_model.2)

but doesn't happen all the time:

RIKZ$fweek <- factor(RIKZ$week)
RIKZ_model.3 <- lm(Richness ~ fweek, data = RIKZ)
check_assumptions(RIKZ_model.3)