Model.Formulas: Develop formulas for a variety of different types of modles

View source: R/Index_functions.R

Model.FormulasR Documentation

Develop formulas for a variety of different types of modles

Description

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.

Usage

Model.Formulas(
  Predictors,
  Response,
  model,
  offset = NULL,
  VarType,
  names,
  count.n,
  basis
)

Arguments

Predictors

see help pages for \codeGLM.Formulas and ZI.Formulas for description.

Response

see help pages for GAM.Formulas, GLM.Formulas, and ZI.Formulas for description.

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 GLM.Formulas and ZI.Formulas for description.

VarType

see help pages for GAM.Formulas, GLM.Formulas, and ZI.Formulas for description.

names

see help pages for GAM.Formulas, GLM.Formulas, and ZI.Formulas for description.

count.n

see help page for ZI.Formulas for description.

basis

see help pages for GAM.Formulas for description.

Value

Character string representing a potential model formula.

See Also

Other Model Formulas: GAM.Formulas(), GLM.Formulas(), ZI.Formulas()

Examples

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

ballengerj/FishyR documentation built on June 17, 2022, 10:33 p.m.