fit_cox: Function that fits Cox proportional hazards models

View source: R/fit_model.R

fit_coxR Documentation

Function that fits Cox proportional hazards models

Description

Function that fits Cox proportional hazards models

Usage

fit_cox(
  x,
  y,
  strata,
  weights,
  offset,
  control,
  method,
  rownames,
  nocenter,
  fast = TRUE
)

Arguments

x

a matrix of predictors excluding intercept with nobs observations.

y

a Surv object.

strata, control, rownames, nocenter

passed to survival::coxph.fit().

weights

a numeric vector of length nobs of 'prior weights' to be used in the fitting process.

offset

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

method

a character string specifying the method for tie handling. See survival::coxph().

fast

a logical which determines how the model is fitted. The default TRUE uses fast fitting routines (i.e. survival::coxph.fit()), while FALSEuses the normal fitting routines (survival::coxph()) (used for the final output of mfp2).

Value

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 (not used).

  • fit: the fitted model object.


mfp2 documentation built on Nov. 15, 2023, 1:06 a.m.