View source: R/Index_functions.R
GAM.Formulas | R Documentation |
GAM.Formulas
generates a character vector that can be used to
represent formulas for use in individual GAM model runs. The intent is to
quickly generate a GAM model formula that incorporates information from
several potential covariates, the type of covariate utilized, and the
spline "basis" you specify.
GAM.Formulas(Response, names, VarType, basis = "cr")
Response |
Character string specifying the name of the response variable. This should match a specific column name in your data frame. |
names |
character vector representing the names of unique co-variates you want to include in your GAM model. These should match specific column names in your data frame. |
VarType |
character string denoting the type of co-variate (continuous ("C") or discrete ("F")) for each co-varaite listed in *predictors*. This character string must be the same length as the character string specified by *predictors*. If a value other than "C" or "F" is provided, the function will return an error. |
basis |
a two letter character string indicating the (penalized)
smoothing basis to use (e.g., "tp" for thin plate regression spline, "cr"
for cubic regression spline). see |
Character string representing a potential GAM model formulat which represents the proposed model structure defined by the function inputs.
Other Model Formulas:
GLM.Formulas()
,
Model.Formulas()
,
ZI.Formulas()
data(iris) form <- GAM.Formulas(Response = "Sepal.Length", names = c("Petal.Length", "Petal.Width", "Sepal.Width", "Species"), VarType = c(rep("C", 3), "F"), basis = "tp") form
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.