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() falls back to predict and doesn't create a warning if variable doesn't exist #407

Open
florianhartig opened this issue Apr 10, 2024 · 1 comment
Milestone

Comments

@florianhartig
Copy link
Owner

Reported via email

There was no typo in that script I first sent you, because I had rewritten the variable names to make it easier to follow (because I had long variable names).

Here is an example that would reproduce what I was wondering:

mod <- glmer(cbind(shared_richness, non_shared_richness) ~ built + outdoor + timepoint + (1|recoded_person_ID), family=binomial, data=dat)
simulationOutput <- simulateResiduals(fittedModel = mod, plot = T)
plotResiduals(simulationOutput, form = dat$BUILT)

So in this case, if I don’t have variable BUILT in my data, I don’t get any warning message. Instead, I get predicted() on x plot.

Have to check if this is indeed the case and probably best to throw an error instead!

@melina-leite
Copy link
Collaborator

I did a test and indeed it still presents the plot without any problem

dat <- createData(family=binomial(), binomialTrials = 20)


mod <- glmer(cbind(observedResponse1, observedResponse0) ~ Environment1 + 
               (1|group), family=binomial, data=dat)
simulationOutput <- simulateResiduals(fittedModel = mod, plot = T)
plotResiduals(simulationOutput, form = dat$BUILT)

I'll have a look at the code to think of a solution (to include the error message).

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

No branches or pull requests

2 participants