Wrapper function for `lm`, `glm`, and `svyglm`.
Usage
fitModel(
y,
x,
data,
family = "gaussian",
link = switch(family, gaussian = "gaussian", binomial = "logit", poisson = "log",
negbin = "log"),
design = "simple",
svydes = NA,
surv_params = NULL,
...
)
Arguments
- y
character string representing the response,
- x
character string of the explanatory variables,
- data
name of the object containing the data.
- family
gaussian, binomial, poisson (so far, no others will be added)
- link
the link function to use
- design
data design specification. one of 'simple', 'survey' or 'experiment'
- svydes
a vector of arguments to be passed to the svydesign function, excluding data (defined above)
- surv_params
a vector containing arguments for
survival::Surv()
- ...
further arguments to be passed to lm, glm, svyglm, such as offset, etc.