florianhartig / DHARMa

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

Influential data points, leverage, cook's distance #428

Open melina-leite opened 2 months ago

melina-leite commented 2 months ago

Ideas to develop about how to measure the influence of data points in DHARMa, something like Cook's distance, in a simpler and more general way.

Some references:

florianhartig commented 1 month ago

some code to play around with

testData = createData(sampleSize = 100, family = gaussian(), fixedEffects = 1,
                      randomEffectVariance = 0, temporalAutocorrelation = 10)

fittedModel <- lm(observedResponse ~ Environment1, data = testData)
res = simulateResiduals(fittedModel, n = 1000)

plot(res)

resid = residuals(res, quantileFunction = qnorm, outlierValues = c(-5,5))

plot(resid~res$fittedPredictedResponse)

par(mfrow=c(2,2))

plot(fittedModel)

qqnorm(resid)
florianhartig commented 1 month ago

Check also

melina-leite commented 1 month ago

https://github.com/florianhartig/DHARMa/issues/171