glm
model, without computing the model matrix or the response vector.
glm.fit(x, y, w, start, offset, family, maxit, epsilon, trace, null.dev, qr, ...)
family$initialize
.
binomial
(default is
gaussian
).
TRUE
iterations details are printed during execution.
FALSE
.
TRUE
, the
qr
decomposition of
x*sqrt(w)
is returned with the fit; default is
FALSE
.
glm
object.
In particular, some of the extractor functions like
summary.glm
produce appropriate output.
This function is useful for simulations or bootstrapping, where you use
the same data frame over and over again. Using
glm.fit
for bootstrapping
saves a large amount of computational time, since it only fits a
glm
model
and does not create the model matrix. Thus, no formula needs to be
specified as an argument. The
glm.fit
function is called
internally by
glm
to do the actual model fitting.
The
glm.fit
function is the work-horse for
glm
, and is named as
the default
method
in the definition of
glm
.
It receives
x
and
y
data rather than a formula, but
still uses the
family
object to define the IRLS steps.
Users can write their own versions of
glm.fit
, and pass the name of their
function via the
method
argument to
glm
.
Care should be taken to include as many of the arguments as feasible,
but definitely the
...
argument, which will absorb any additional
arguments given in the call from
glm
.
The name of the method can optionally be passed as a
"method"
attribute of the family argument.
This allows users to define, say, a
cox
family, with
"method"
attribute
"cox.fit"
;
glm
will automatically look for a fitting
function
cox.fit
and use it instead of
glm.fit
.
glm(Times ~ Dose + Age, family = "cox", method = "glm.fit.cox")