Learn R Programming

eha (version 1.2-18)

coxreg.fit: 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 = "breslow", center = TRUE,
boot = FALSE, efrac = 0, calc.hazards = TRUE,
calc.martres = TRUE, control, verbose = TRUE)

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".
center
See coxreg.
boot
Number of bootstrap replicates. Defaults to FALSE, no bootstrapping.
efrac
Upper limit of fraction failures in 'mppl'.
calc.hazards
Should estimates of baseline hazards be calculated?
calc.martres
Should martingale residuals be calculated?
control
See coxreg
verbose
Should Warnings about convergence be printed?

Value

  • A list with components
  • coefficientsEstimated regression parameters.
  • varCovariance matrix of estimated coefficients.
  • loglikFirst component is value at init, second at maximum.
  • scoreScore test statistic, at initial value.
  • linear.predictorsLinear predictors.
  • residualsMartingale residuals.
  • hazardEstimated baseline hazard. At value zero of 'design' variables.
  • meansMeans of the columns of the design matrix.
  • bootstrapThe bootstrap replicates, if requested on input.
  • converTRUE if convergence.
  • f.converTRUE if variables converged.
  • failTRUE if failure.
  • iterNumber of performed iterations.

Details

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

See Also

coxreg, risksets

Examples

Run this code
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))

Run the code above in your browser using DataLab