mfp2Fits generalized linear models and Cox proportional hazard models.
fit_model(
x,
y,
family = "gaussian",
weights = NULL,
offset = NULL,
method = NULL,
strata = NULL,
control = NULL,
rownames = NULL,
nocenter = NULL,
fast = TRUE
)a matrix of predictors (excluding intercept) with column names.
If column names are not provided they are set according to
colnames(x, do.NULL = FALSE).
a vector for the outcome variable for glms, and a Surv object
for Cox models.
a character strong specifying glm family to be used, or "cox" for Cox models. The default family is set to 'Gaussian'.
a character string specifying the method for tie handling.
See survival::coxph().
parameters for Cox
or glm. See survival::coxph() or stats::glm() for details.
passed to fit_glm() and fit_cox().
@return A list with the following components:
logl: the log likelihood of the fitted model.
coefficients: regression coefficients.
df: number of parameters (degrees of freedom).
sse: residual sum of squares.
fit: the object returned by the fitting procedure.
Computations rely on fit_glm() and fit_cox().