bandwidth: bandwidth selection function

Description Usage Arguments Value Examples

View source: R/bandwidth.R

Description

bandwidth selection function

Usage

1
bandwidth(x, y, method = "CV")

Arguments

x

the explanatory variable - numeric

y

the response variable - numeric

method

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

Value

Calculates the bandwidth value using cross validation or plug-in method (for localLin and localCst methods)

Examples

1
2
3
4
5
6
7
#create a data frame
example<-data.frame(sample(30:42,10,rep=TRUE),sample(800:5000,10,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 window value
bandwidth(x,y)

HugoBrtn/quantCurves documentation built on Dec. 31, 2021, 12:01 a.m.