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