CentCurv: Centile curves based on different methods

Description Usage Arguments Value Examples

View source: R/CentCurv.R

Description

Centile curves based on different methods

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
CentCurv(
  x,
  y,
  window.select = "CV",
  method,
  lambdas = 0,
  kernel = "gauss",
  cents = c(0.03, 0.25, 0.5, 0.75, 0.97),
  disp_window = FALSE
)

Arguments

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) )

Value

Plots centile curves according to the method chosen

Examples

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)

amouchot/nparamEstim documentation built on Feb. 6, 2021, 9:16 p.m.