nauf
contrasts.The fixed effects regression functions nauf_lm
, nauf_glm.nb
,
and nauf_glm
fit linear, negative binomial, and other generalized
linear models, respectively, impelementing nauf_contrasts
.
nauf_glm(formula, family = gaussian, data = NULL, weights, subset,
na.action = na.pass, start = NULL, etastart, mustart, offset,
control = list(...), model = TRUE, method = "glm.fit", x = TRUE,
y = TRUE, contrasts = NULL, ncs_scale = attr(formula,
"standardized.scale"), ...)nauf_lm(formula, data = NULL, subset, weights, na.action = na.pass,
method = "qr", model = TRUE, x = TRUE, y = TRUE, qr = TRUE,
singular.ok = TRUE, contrasts = NULL, offset, ncs_scale = attr(formula,
"standardized.scale"), ...)
nauf_glm.nb(formula, data = NULL, weights, subset, na.action = na.pass,
start = NULL, etastart, mustart, control = stats::glm.control(...),
method = "glm.fit", model = TRUE, x = TRUE, y = TRUE,
contrasts = NULL, ncs_scale = attr(formula, "standardized.scale"), ...,
init.theta, link = log)
Changes to the default values for these arguments
are ignored with a warning. See nauf_model.frame
.
Chages to the default values for these arguments are ignored with a warning. See 'Details'.
A positive number to be passed as the scale
argument
to named_contr_sum
for all unordered factors.
See nauf_model.frame
.
A fitted model with class nauf.glm
(inheriting from lm
,
and also possibly glm
and/or negbin
depending on the
regression). For the elements contained in the object, and additional
class attributes the model may contain, see lm
,
glm
, and glm.nb
.
Methods for S3 generic functions from the
stats
and MASS
packages should work for nauf.glm
models as they normally would for the related regression models not fit
with nauf_contrasts
. If you encounter a generic function in
these packages which does not function properly, please report the issue at
https://github.com/CDEager/nauf/issues.
nauf_lm
is based on lm
in the
stats
package, nauf_glm
on glm
in the
stats
package, and nauf_glm.nb
on glm.nb
in
the MASS
package; but implementing nauf_contrasts
. The
nauf
functions have all the same arguments as the functions they are
based on, but additionally ncs_scale
, which is passed to
nauf_model.frame
. Other than ncs_scale
, the arguments
have the same functions as they do in the functions they are based on. The
default values for na.action
, contrasts
, model
,
x
, and y
cannot be changed. For na.action
and
contrasts
, see nauf_model.frame
. Forcing model
,
x
, and y
to be TRUE
ensures that the fitted model
retains the model frame, model matrix, and response, respectively. This is
necessary for some generic functions applied to the fitted model to work
properly.
nauf_contrasts
for a description of the contrasts
applied to unordered factors; and lm
,
glm
, and glm.nb
for argument
definitions.
dat <- plosives
dat$spont[dat$dialect == "Valladolid"] <- NA
sobj <- standardize(intdiff ~ voicing * dialect * spont, dat)
mod <- nauf_lm(sobj$formula, sobj$data)
Run the code above in your browser using DataLab