Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

agreg.fit

Cox model fitting functions


Description

These are the the functions called by coxph that do the actual computation. In certain situations, e.g. a simulation, it may be advantageous to call these directly rather than the usual coxph call using a model formula.

Usage

agreg.fit(x, y, strata, offset, init, control, weights, method,
rownames, resid=TRUE, nocenter=NULL)
coxph.fit(x, y, strata, offset, init, control, weights, method,
rownames, resid=TRUE, nocenter=NULL)

Arguments

x

Matix of predictors. This should not include an intercept.

y

a Surv object containing either 2 columns (coxph.fit) or 3 columns (agreg.fit).

strata

a vector containing the stratification, or NULL

offset

optional offset vector

init

initial values for the coefficients

control

the result of a call to coxph.control

weights

optional vector of weights

method

method for hanling ties, one of "breslow" or "efron"

rownames

this is only needed for a NULL model, in which case it contains the rownames (if any) of the original data.

resid

compute and return residuals.

nocenter

an optional list of values. Any column of the X matrix whose values lie strictly within that set will not be recentered. Note that the coxph function has (-1, 0, 1) as the default.

Details

This routine does no checking that arguments are the proper length or type. Only use it if you know what you are doing!

The resid and concordance arguments will save some compute time for calling routines that only need the likelihood, the generation of a permutation distribution for instance.

Value

a list containing results of the fit

Author(s)

Terry Therneau

See Also


survival

Survival Analysis

v3.2-11
LGPL (>= 2)
Authors
Terry M Therneau [aut, cre], Thomas Lumley [ctb, trl] (original S->R port and R maintainer until 2009), Atkinson Elizabeth [ctb], Crowson Cynthia [ctb]
Initial release
2021-04-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.