coxreg.fit: Cox regression

View source: R/coxreg.fit.R

coxreg.fitR Documentation

Cox regression

Description

Called by coxreg, but a user can call it directly.

Usage

coxreg.fit(
  X,
  Y,
  rs,
  weights,
  t.offset = NULL,
  strats,
  offset,
  init,
  max.survs,
  method = "efron",
  boot = FALSE,
  efrac = 0,
  calc.martres = TRUE,
  control,
  verbose = TRUE,
  calc.hazards = NULL,
  center = NULL
)

Arguments

X

The design matrix.

Y

The survival object.

rs

The risk set composition. If absent, calculated.

weights

Case weights; time-fixed or time-varying.

t.offset

Case offset; time-varying.

strats

The stratum variable. Can be absent.

offset

Offset. Can be absent.

init

Start values. If absent, equal to zero.

max.survs

Sampling of risk sets? If so, gives the maximum number of survivors in each risk set.

method

Either "efron" (default) or "breslow".

boot

Number of bootstrap replicates. Defaults to FALSE, no bootstrapping.

efrac

Upper limit of fraction failures in 'mppl'.

calc.martres

Should martingale residuals be calculated?

control

See coxreg

verbose

Should Warnings about convergence be printed?

calc.hazards

Deprecated. See coxreg.

center

Deprecated. See coxreg.

Details

rs is dangerous to use when NA's are present.

Value

A list with components

coefficients

Estimated regression parameters.

var

Covariance matrix of estimated coefficients.

loglik

First component is value at init, second at maximum.

score

Score test statistic, at initial value.

linear.predictors

Linear predictors.

residuals

Martingale residuals.

hazard

Estimated baseline hazard. At value zero of design variables.

means

Means of the columns of the design matrix.

bootstrap

The bootstrap replicates, if requested on input.

conver

TRUE if convergence.

f.conver

TRUE if variables converged.

fail

TRUE if failure.

iter

Number of performed iterations.

Note

It is the user's responsibility to check that indata is sane.

Author(s)

Göran Broström

See Also

coxreg, risksets

Examples


 X <- as.matrix(data.frame(
                x=     c(0, 2,1,4,1,0,3),
                sex=   c(1, 0,0,0,1,1,1)))
 time <- c(1,2,3,4,5,6,7)
 status <- c(1,1,1,0,1,1,0)
 stratum <- rep(1, length(time))

 coxreg.fit(X, Surv(time, status), strats = stratum, max.survs = 6,
     control = list(eps=1.e-4, maxiter = 10, trace = FALSE))


eha documentation built on Oct. 7, 2024, 1:17 a.m.