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

wtd.var() raises error when method='ML', x is all NA, and any arbitrary weights are assigned #129

Open
mcandocia opened this issue May 12, 2020 · 0 comments

Comments

@mcandocia
Copy link

Example:

wtd.var(c(NA,NA,NA), weights=1:3, method='ML')

Error in stats::cov.wt(cbind(x), weights, method = "ML") : 
  weights must be non-negative and not all zero

raises an error, while

wtd.var(c(NA,NA,NA), method='ML')
# [1] NA

does not.

At worst a warning should be raised.

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

1 participant