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

Unexpected error with repeated measures #1

Open
stemkov opened this issue Feb 14, 2019 · 2 comments
Open

Unexpected error with repeated measures #1

stemkov opened this issue Feb 14, 2019 · 2 comments

Comments

@stemkov
Copy link

stemkov commented Feb 14, 2019

I'm getting an unexpected fatal error in weib.limit() when there are many repeated first measures.

For example, when I run weib.limit(rep(157,50)), I get the usual warning message about applying a correction when there are repeated earliest measurements, but also a new error reading:

Error in if (theta < ci[1] | theta > ci[2]) { : missing value where TRUE/FALSE needed

This does not happen for every case with when there are repeated earliest measurements. For example, weib.limit(rep(c(157,160,180),each=3)) does not experience the fatal error.

This appears to be happening in the "# Check for tail vs. centre of distribution issues" section which was added recently.

@willpearse
Copy link
Owner

Ah, I think I do know why this is happening: now that we have the new CI checking code, there is no code to check that a CI can be calculated before checking the CI (does that make sense?). Let me have a quick poke around, though, because I'm loathe to push something immediately and then make a new problem :p

@willpearse
Copy link
Owner

I think fixed with d0cc197.

The problem was your example cannot have an estimate calculated for it (there's only one value in the entire thing), and so the missing value problem refers to how you can't run a conditional on an NA. I've added a check before that conditional to make sure that everything isn't NA before running that check; I don't think there's a need to flag anything further because, frankly, the estimates are NA in such cases and not returning a value is sufficiently clear that we couldn't calculate an estimate.

Does that make sense? If you want to write a check to make sure there is more than one observation in the input data before running the method I'm happy to merge it, but the danger with writing so many checks is that it lulls the user into the false sense that they don't need to check their input data for sense...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants