Giter VIP home page Giter VIP logo

r-code's People

Contributors

nzcoops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

r-code's Issues

polynomial regression formulae

In Appendix B of the 4th report (NIH/NHLBI), the polynomial regression formulae are the same for SPB and DBP z-scores, with the exception of different beta coefficients e.g. the quartic polynomial in age has the form beta1*(age -10) + beta2*(age - 10)^2 + beta3*(age-10)^3 + beta4*(age-10)^4, where you provide the betas in in your table bplu.

This is in fact what you specify for female SBP , where each term has the form beta*(age-10)^x

    mu <- bplu$sbpf[1] +
    sum(bplu$sbpf[2]*(age[i]-10),bplu$sbpf[3]*(age[i]-10)^2,bplu$sbpf[4]*(age[i]-10)^3,bplu$sbpf[5]*(age[i]-10)^4) +
    sum(bplu$sbpf[6]*z_ht[i],bplu$sbpf[7]*z_ht[i]^2,bplu$sbpf[8]*z_ht[i]^3,bplu$sbpf[9]*z_ht[i]^4)
    sbp_z[i] <- (sbp[i] - mu)/bplu$sbpf[10]

However, when I look at the analogous formula for female DBP, you have written (beta*(age-10))^2 i.e. the beta is squared (and cubed and raised to the fourth power), which is a very different result.

    mu <- bplu$dbpf[1] +
    sum(bplu$dbpf[2]*(age[i]-10),(bplu$dbpf[3]*(age[i]-10))^2,(bplu$dbpf[4]*(age[i]-10))^3,(bplu$dbpf[5]*(age[i]-10))^4) +
    sum(bplu$dbpf[6]*z_ht[i],bplu$dbpf[7]*z_ht[i]^2,bplu$dbpf[8]*z_ht[i]^3,bplu$dbpf[9]*z_ht[i]^4)
    dbp_z[i] <- (dbp[i] - mu)/bplu$dbpf[10]

If I'm not mistaken, the beta should be outside the bracket, no?

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.