LocalPol: Local Polynomial method for estimating centile curves

Description Usage Arguments Value Examples

View source: R/LocPol.R

Description

Local Polynomial method for estimating centile curves

Usage

1
2
3
4
5
6
7
LocalPol(
  x,
  y,
  bandwidth.method = "CV",
  kernel.choice = "epan",
  cents = c(0.03, 0.25, 0.5, 0.75, 0.97)
)

Arguments

x

the explanatory variable - numeric

y

the response variable - numeric

bandwidth.method

the bandwidth method choice: CV or plug-in. Default is CV.

kernel.choice

The kernel choice: Epanechnikov, gaussian, circular... See kernel.select function. Default is set to Epanechnikov.

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 the centile curves and returns a list object containing bandwidth value, kernel and estimated centiles values.

Examples

1
2
3
4
5
6
7
#create a data frame
example<-data.frame(sample(30:42,50,rep=TRUE),sample(800:5000,50,rep=TRUE))
colnames(example)<-c("Gestational Age in weeks","Weight in gramms")
x<-example$`Gestational Age in weeks`
y<-example$`Weight in gramms`
#calculate the centile and plot the curves
LocalPol(x,y)

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