GithubHelp home page GithubHelp logo

growthcharts / chartplotter Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 793 KB

Analysing and Plotting Growth Curves

Home Page: http://growthcharts.org/chartplotter/

License: GNU Affero General Public License v3.0

R 98.74% Rebol 1.26%
dutch growth-charts growth-curves james-server

chartplotter's People

Contributors

stefvanbuuren avatar

Watchers

 avatar  avatar

chartplotter's Issues

Mismatch in Z-score calculations

There is a mismatch between

  • the Z-scores used in the brokenstick models calculated for the donor data
  • the Z-scores calculated by the chartplotter::find_matches() function

For example, from chartplotter::find_matches() we convert using clopus::nl1997. No preterm references are used for any case with ga <= 36, which deviates from the Z-score as calculated in the donordata package.

      # transform into Z scale
      z <- y2z(y = xy[[yname]], x = xy[["age"]], ref = clopus::nl1997,
                 yname = yname, sex = xy[["sex"]], sub = "NL",
                 drop = TRUE)

      # predict according to the brokenstick model (Z scale)
      df <- data.frame(age = xy["age"], z = z, id = 1)
      colnames(df) <- c("age", paste(yname, "z", sep = "."), "id")
      zhat <- predict(bsm, df, x = "knots", shape = "vector")

      # back-transform prediction into Y scale
      yhat <- z2y(z = zhat, x = get_knots(bsm), ref = clopus::nl1997,
                    yname = yname, sex = xy[["sex"]][1L], sub = "NL",
                    drop = TRUE)

The code is correct for terms, but not for pre-terms. Preferably, these conversions should be replaced by clopus::transform_z() and clopus::transform_y().

Error in validGP(gp) : must specify only one of 'font' and 'fontface'

After updating R packages to R 4.2.1 I get

library(chartplotter)
fn <- system.file("extdata", "bds_v1.0", "smocc", "Laura_S.json", package = "jamesdemodata")
ind <- bdsreader::read_bds(fn)

g <- process_chart(ind, chartcode = "NJAA",
                   dnr = "smocc", period = c(0.5, 1.1667), nmatch = 10, break_ties = TRUE)
#> New names:
#> • `NA.` -> `NA....30`
#> • `NA..1` -> `NA..1...31`
#> • `NA..2` -> `NA..2...32`
#> • `NA..3` -> `NA..3...33`
#> • `NA.` -> `NA....47`
#> • `NA..1` -> `NA..1...48`
#> • `NA..2` -> `NA..2...49`
#> • `NA..3` -> `NA..3...50`
#> • `NA..4` -> `NA..4...51`
#> • `NA.` -> `NA....65`
#> • `NA..1` -> `NA..1...66`
#> • `NA..2` -> `NA..2...67`
#> • `NA..3` -> `NA..3...68`
#> • `NA..4` -> `NA..4...69`
grid::grid.draw(g)
#> Error in validGP(gp): must specify only one of 'font' and 'fontface'

Created on 2022-08-16 by the reprex package (v2.0.1)

The output "New names:" should not be there. Also, the validGP error is novel.

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.