## Not run:
# library(intubate)
# library(gam)
# data(kyphosis)
#
# ## Original function to interface
# fit <- gam(Kyphosis ~ s(Age,4) + Number, family = binomial, data = kyphosis,
# trace = TRUE)
# summary(fit)
# fit <- gam(Kyphosis ~ poly(Age,2) + s(Start), data = kyphosis,
# family = binomial, subset = Number > 2)
# summary(fit)
# fit <- gam(Ozone^(1/3) ~ lo(Solar.R) + lo(Wind, Temp),
# data = airquality, na = na.gam.replace)
# summary(fit)
#
# ## The interface reverses the order of data and formula
# fit <- ntbt_gam(kyphosis, Kyphosis ~ s(Age,4) + Number,
# family = binomial, trace = TRUE)
# summary(fit)
# fit <- ntbt_gam(data = kyphosis, Kyphosis ~ poly(Age,2) + s(Start),
# family = binomial, subset = Number > 2)
# summary(fit)
# fit <- ntbt_gam(data = airquality, Ozone^(1/3) ~ lo(Solar.R) + lo(Wind, Temp),
# na = na.gam.replace)
# summary(fit)
#
# ## so it can be used easily in a pipeline.
# library(magrittr)
# kyphosis %>%
# ntbt_gam(Kyphosis ~ s(Age,4) + Number,
# family = binomial, trace = TRUE) %>%
# summary()
#
# kyphosis %>%
# ntbt_gam(Kyphosis ~ poly(Age,2) + s(Start),
# family = binomial, subset = Number > 2) %>%
# summary()
#
# airquality %>%
# ntbt_gam(Ozone^(1/3) ~ lo(Solar.R) + lo(Wind, Temp),
# na = na.gam.replace) %>%
# summary()
# ## End(Not run)
Run the code above in your browser using DataLab