Giter VIP home page Giter VIP logo

rgho's People

Contributors

kzarca avatar pierucci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rgho's Issues

bug: get_who_mr & WHO database display diferent results

I am looking for the female MR aged 44.25 years in Spain.

This is what I get from running my code:
image

This is what I see in the UI:
image
Note that the latest data available is 2021, not 2019. In 2019 the death rate was 96.4 per 100.000 individuals. See my code for a reproducible example with a seed in case I am missing something on my side, else this seems to be a bug.

devtools::install_github("aphp/rgho")
library(rgho)

set.seed(42)

# Create a vector of ages (random values between 12 and 75)
ages <- sample(12:75, 20, replace = TRUE)
# Create a vector of genders (random values of 0 or 1)
# 0 is considered male, 1 is considered female
genders <- sample(0:1, 20, replace = TRUE)
# Create the dataframe
patients <- data.frame(age = ages, gender = genders)
print(patients)

# Compute the mean age
mean_age <- mean(patients$age)
print(mean_age)
# Compute the percentage of females
percentage_female <- sum(patients$gender == 1) / nrow(patients) * 100
print(percentage_female)

# compute mortality rate for each gender
mr_fmle = get_who_mr(mean_age, sex="FMLE", country="ESP", local = FALSE)
print(mr_fmle)
mr_mle = get_who_mr(mean_age, sex="MLE", country="ESP", local = FALSE)
print(mr_mle)

get_who_mr returns NA

Trying to retrieve the latest data available (2021) from WHO in Canada. Mean age is 58 years, sex is female.
This is my code, following the docs:

age = 58
sex = 0
country = "CAN" #Canada
sex_cat = ifelse(sex == 0, "FMLE", "MLE")
mr = get_who_mr(age, sex_cat, local = FALSE, country = country, year="latest")
[1] NA

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.