Description Usage Arguments Value Examples
Centile curves based on different methods
1 2 3 4 5 6 7 8 9 10 |
x |
the explanatory variable - numeric |
y |
the response variable - numeric |
window.select |
the bandwidth method choice: CV or plug-in. Default is CV. |
method |
str - The method choosen for displaying the curve. Could be: Local constant, Local linear, Cubic splines or B-splines. |
lambdas |
set to 0. To be set if method chosen is "B-Splines". Tunes the tradeoff between the goodness of fit and the regularity of the spline - numeric value or numeric vector |
cents |
A numeric vector that represents the centiles calculated. Default is set to cents=c(0.03,0.25,0.5,0.75,0.97) ) |
Plots centile curves according to the method chosen
1 2 3 4 5 6 7 | #create a sample data frame
sample<-data.frame(sample(30:42,50,rep=TRUE),sample(800:5000,50,rep=TRUE))
colnames(sample)<-c("Gestational Age in weeks","Weight in gramms")
x<-sample$`Gestational Age in weeks`
y<-sample$`Weight in gramms`
CentCurv(x,y,method='Cubic splines')
CentCurv(x,y,method='B-Splines',lambdas=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.