Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plotResiduals outlier colors black if test is not significant #453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

melina-leite
Copy link
Collaborator

Created to fix #451

Problem

Now, plotResiduals fails when using a nonDHARMa (and not a model) object for the simulationOutput argument.

Possible causes

Although, plotResiduals could work with nonDHARMa objects (using ensureDHARMa(convert = TRUE), testOutliers needs a DHARMa OR a model object (ensureDHARMa(convert = "Model") ).

So, when I test outliers to choose the color of the outliers in the plot, it throws an error. See example below:

testData = createData(sampleSize = 100, overdispersion = 0,
                      randomEffectVariance = 0)
fittedModel <- glm(observedResponse ~ Environment1 ,
                   family = "poisson", data = testData)
simulationOutput <- simulateResiduals(fittedModel = fittedModel, n = 50)

plotResiduals(simulationOutput)

plotResiduals(simulationOutput$scaledResiduals, form =
                simulationOutput$fittedPredictedResponse)

@melina-leite melina-leite added this to the 0.4.8 milestone Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

outliers sign in plotResiduals - change red to black if testOutliers is not significant
1 participant