toformula: Build a Formula Based on Data for 'modgam' Function

View source: R/toformula.R

toformulaR Documentation

Build a Formula Based on Data for modgam Function

Description

Based on the arguments in modgam, build a formula used for model fitting.

Usage

toformula(formula, data,m="adjusted",surv = FALSE, span=0.5,degree=2,
          smooth = TRUE,offset='')

Arguments

formula

a user specified formula expression (for modgam).

data

a well structured data frame with the two geolocation parameters in the first and second columns. data is ingnored if formula is specified.

m

use m="adjusted" to specify a model including adjusted confounders. Use m="unadjusted" to specify a unadjusted model.

surv

surv=TRUE specifies a model for censored surival dataset.

span, degree

smoothing parameters used for smoothing functions (see details in modgam) if smooth=TRUE.

smooth

smooth=TRUE specifies a smooth term in the model.

offset

the name for offset.

Value

The function returns the formula for the model.

Author(s)

Lu Bai

Send bug reports to sbartell@uci.edu.

See Also

modgam, .

Examples


data(CAdata)
toformula(data=CAdata, surv=TRUE)


MapGAM documentation built on July 26, 2023, 5:12 p.m.