best.model.f: Find the best shape constrained GAM for y~x

Description Usage Arguments Examples

View source: R/bestE.r

Description

Uses the package scam to fit shape constrained gam models of y~ s(x). Gaussian link function. All the scam shape are fitted and the best one is selected. If the smooth term is not significant you may not want to use the model. It depends on your hypothesis and how you are using the model and residuals.

Usage

1
best.model.f(x, y, plot = F)

Arguments

x

the explanatory variable

y

the response variable

plot

if T then a plot of the best model (lowest AIC) fit is plotted with pertinent statistics in plot titles

Examples

1
      best.model.f(USArrests$UrbanPop, USArrests$Rape, plot=T)

duplisea/bestE documentation built on Sept. 24, 2020, 12:45 a.m.