View source: R/Index_functions.R
| Model.Formulas | R Documentation |
Model.Formulas generates a character vector that can be used to
represent formulas for use in individual GAM, GLM, or zero-inflation
model runs. In essence it is a wrapper for the individual functions
GAM.Formulas, GLM.Formulas, and
ZI.Formulas. The intent is to quickly generate model
formulas that incorporates information from several potential covariates
and the type of covariate utilized.
Model.Formulas( Predictors, Response, model, offset = NULL, VarType, names, count.n, basis )
Predictors |
see help pages for \codeGLM.Formulas and
|
Response |
see help pages for |
model |
character string specifiying the type of model formula to be constructed. Currently only "GAM", "GLM", and "ZI" are acceptable values, with all others giving an error. |
offset |
see help pages for |
VarType |
see help pages for |
names |
see help pages for |
count.n |
see help page for |
basis |
see help pages for |
Character string representing a potential model formula.
Other Model Formulas:
GAM.Formulas(),
GLM.Formulas(),
ZI.Formulas()
data(iris)
# GAM Model
form.GAM <- GAM.Formulas(Response = "Sepal.Length", names =
c("Petal.Length", "Petal.Width", "Sepal.Width", "Species"), VarType =
c(rep("C", 3), "F"), basis = "tp")
form.GAM
# GLM Model
form.GLM <- GLM.Formulas(Response = "Sepal.Length", Predictors =
c(1, 2, 0, 3), names = c("Petal.Length", "Petal.Width", "Sepal.Width",
"Species"), VarType = c(rep("C", 3), "F"))
form.GLM
# Zero-Inflation Model
form.ZI <- ZI.Formulas(Response = "Sepal.Length", Predictors =
c(1, 2, 0, 3, 1, 0, 0, 0), names = rep(c("Petal.Length", "Petal.Width",
"Sepal.Width", "Species"), 2), VarType = rep(c(rep("C", 3), "F"), 2),
count.n = 4)
form.ZI
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.