Giter Club home page Giter Club logo

mvogel78 / childsds Goto Github PK

View Code? Open in Web Editor NEW
15.0 5.0 0.0 2.18 MB

Calculation of standard deviation scores adduced from different growth standards (WHO, US, UK, Germany, Italy, China, etc). Therefore, the calculation of SDS-values for different measures like BMI, weight, height, head circumference, different ratios, etc. are easy to carry out. Also, references for laboratory values in children are available: serum lipids, iron-related blood parameters.

Home Page: https://github.com/mvogel78/childsds/wiki/List-of-Reference-Tables-by-Item

R 100.00%
pediatric sds

childsds's Introduction

I moved the repository to Bitbucket for personal reasons.

childsds

List of available references/LMS charts

  • you find a list of available reference tables by region and by item here.

Installation

  • version 0.6.4 from cran via install.packages() or the respective menu

Basic use

Transformation into sds

library(childsds)
## generate example data
x <- data.frame(height=c(50,100,60,54),
		  sex=c("m","f","f","m"),
		  age=c(0,2.9,0.6,0.2))
x$height.sds <- sds(value = x$height,
		      age = x$age,
		      sex = x$sex, male = "m", female = "f",
		      ref = who.ref, item = "height")
head(x)

#+RESULTS[46a6ba3828dbb6c977bc976a6280e0b191bc02ee]:

  height sex age  height.sds
1     50   m 0.0  0.06116878
2    100   f 2.9  1.54150151
3     60   f 0.6 -3.26293906
4     54   m 0.2 -2.82189275

make_percentile_tab()

create a percentile table

library(childsds)
head(tab <- make_percentile_tab(ref = nl4.ref,
				  item = "heightM",
				  perc = c(5,50,95),
				  age = 1:3))
     sex age perc_05_0 perc_50_0 perc_95_0 nu       mu      sigma
1   male   1  72.82291  77.15261  81.48232  1 77.15261 0.03411775
2   male   2  82.10371  87.67000  93.23629  1 87.67000 0.03860000
3   male   3  89.97701  96.28000 102.58299  1 96.28000 0.03980000
4 female   1  70.58366  74.89305  79.20245  1 74.89305 0.03498225
5 female   2  82.06492  86.76000  91.45508  1 86.76000 0.03290000
6 female   3  89.41744  94.83000 100.24256  1 94.83000 0.03470000

use the stack argument to create a dataframe in the long format for use in ggplot

library(childsds)
head(tab <- make_percentile_tab(ref = nl4.ref,
				  item = "heightM",
				  perc = c(5,50,95),
				  age = seq(0,20,by=0.1),
				  stack = T))
  age  sex  variable    value
1 0.0 male perc_05_0 47.82905
2 0.1 male perc_05_0 51.65139
3 0.2 male perc_05_0 55.37913
4 0.3 male perc_05_0 58.68443
5 0.4 male perc_05_0 61.60275
6 0.5 male perc_05_0 64.21947
library(ggplot2)
ggplot(tab, aes( x = age, y = value, group=paste(sex, variable))) +
    geom_line(aes(linetype = sex)) +
    theme_classic() +
    theme(legend.position = c(0.1,0.8))

#+RESULTS[9e68fab1cedee6b9007e7fe1696cac77f23d3ef4]: fig_1.png

childsds's People

Contributors

mvogel78 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

childsds's Issues

Percent BMI bug

The percent BMI code appears to be bugged and is outputting a data.frame.

See attached images:

Capture_SDS_ERROR

Capture_SDS_ERROR_2

warnings using ukwho.ref for BMI

Hi
Whenever I run the sds(.) with ref = ukwho and item ='bmi' I get a series 8 of identical warnings "In regularize.values(x, y, ties, missing(ties), na.rm = na.rm) :
collapsing to unique 'x' values"

It does however produce a value which looks credible.
I am not getting this message with height or weight or with other references (such as uk1990)

Any ideas? Should the results still be reliable despite the warnings

thanks and best wishes
Phil

Adding reference tables to the package

Hi, Thank you for making such a wonderful package. I wonder if it is possible to add my own reference tables into the package so that I can draw a growth chart that fit my smaller population?
I currently have a set of tables containing age, sex, mean, standard deviation, percentile values a 5,25,50,75,90.

Thanks a lot

Hang

Correction for preterm infants

How to set up the correction for preterm infants when calculating SDS or percentile? It seems that we can use the kro.ref. Can you provide a example code? Or shall we set the age of preterm infants as negative values?

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.