nzcoops / r-code Goto Github PK
View Code? Open in Web Editor NEWR code and functions
R code and functions
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.