localLin: Local linear estimator

Description Usage Arguments Value Examples

View source: R/localLin.R

Description

Local linear estimator

Usage

1
2
3
4
5
6
7
8
localLin(
  x,
  y,
  bandwidth.method = "CV",
  kernel = "gauss",
  cents = c(0.03, 0.25, 0.5, 0.75, 0.97),
  disp_window = TRUE
)

Arguments

x

the explanatory variable - numeric

y

the response variable - numeric

bandwidth.method

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

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 and estimated centiles values. Kernel used is gaussian.

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 centiles and plot the curves
localLin(x,y)

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