fit_glm {mfp2}R Documentation

Function that fits generalized linear models

Description

Function that fits generalized linear models

Usage

fit_glm(x, y, family, weights, offset, fast = TRUE)

Arguments

x

a matrix of predictors with nobs observations.

y

a vector for the outcome variable.

family

a family function e.g. stats::gaussian().

weights

a numeric vector of length nobs of 'prior weights' to be used in the fitting process. see stats::glm() for details.

offset

a numeric vector of length nobs of of a priori known component to be included in the linear predictor during fitting.

fast

a logical which determines how the model is fitted. The default TRUE uses fast fitting routines (i.e. stats::glm.fit()), while FALSE uses the normal fitting routines (stats::glm()) (used for the final output of mfp2). The difference is mainly due to the fact that normal fitting routines have to handle data.frames, which is a lot slower than using the model matrix and outcome vectors directly.

Value

A list with the following components:


[Package mfp2 version 1.0.0 Index]