WorldHealthOrganization / anthro

Computation of the WHO Child Growth Standards
https://worldhealthorganization.github.io/anthro/
GNU General Public License v3.0
29 stars 9 forks source link

Prevalence caluction can fail #2

Closed dirkschumacher closed 5 years ago

dirkschumacher commented 5 years ago

Not sure yet what causes it but certain combinations in the gregion can lead to the following error

Error in family$linkfun(mustart) : 
  Argument mu must be a nonempty numeric vector

Maybe too few observations?

dirkschumacher commented 5 years ago
library(anthro)
res <- anthro_prevalence(
  sex = c(1, 1, 1, 1, 1, 2),
  age = c(1001, 1000, 1010, 1000, 300),
  weight = c(18, 15, 10, 15, 15),
  lenhei = c(100, 80, 100, 100, 100)
)
#> Error in family$linkfun(mustart): Argument mu must be a nonempty numeric vector

Created on 2019-02-22 by the reprex package (v0.2.1)