compareCurv {quantCurves} | R Documentation |
Centile curves according to different methods
Description
Centile curves according to different methods
Usage
compareCurv(x, y, bandwidth.method = "CV", lambdas, data, leg = FALSE)
Arguments
x |
the explanatory variable - numeric |
y |
the response variable - numeric |
bandwidth.method |
the method chosen to calculate bandwdth. Could be cross validation or Plug-in. Default is set to CV. |
lambdas |
to be set for "B-Splines". Can be a vector or a single numeric value. Tunes the tradeoff between the goodness of fit and the regularity of the spline - numeric value or numeric vector |
data |
the abnormal/external data we want to compare the curves with |
leg |
Boolean. Should the legend be desplayed (TRUE) or not (FALSE). |
Value
Plots centile curves with the different methods and displays them on the same figure as the noise data to compare
Examples
#create a sample data frame
sample<-data.frame(sample(30:42,30,rep=TRUE),sample(800:5000,30,rep=TRUE))
colnames(sample)<-c("Gestational Age in weeks","Weight in gramms")
x<-sample$`Gestational Age in weeks`
y<-sample$`Weight in gramms`
abnormal<-data.frame(sample(30:42,6,rep=TRUE),sample(800:5000,6,rep=TRUE))
colnames(abnormal)<-c("Gestational Age in weeks","Weight in gramms")
compareCurv(x,y,bandwidth.method="Plug-in",lambdas=1,abnormal)
[Package quantCurves version 1.0.0 Index]