coxreg(formula = formula(data), data = parent.frame(), weights, subset,
t.offset, na.action = getOption("na.action"), init = NULL,
method = c("efron", "breslow", "mppl", "ml"),
control = list(eps = 1e-08, maxiter = 25, trace = FALSE),
singular.ok = TRUE, model = FALSE,
center = TRUE,
x = FALSE, y = TRUE, hazards = TRUE, boot = FALSE, efrac = 0,
geometric = FALSE, rs = NULL,
frailty = NULL, max.survs = NULL)options()$na.action.eps (convergence
    criterion), maxiter (maximum number of iterations), and
    silent (logical, controlling amount of output). You can
    change any component without mention the other(s).center = TRUE (default), the baseline
    hazards are 
    calculated at the means of the 
    covariates and for the reference category for factors, otherwise at
    the value zero. See Details.c("coxreg", "coxph") with components
  center = TRUE. Columns corresponding to
    factor levels gice a zero in the corresponding position in
    means. If center = FALSE, means are all zero.NULL if not).rs is dangerous, see note. It
  can however speed up computing time considerably for huge data sets.efron, and the alternative, breslow,
  are both the same as in coxph in package
  survival. The methods mppl and ml are maximum
  likelihood, discrete-model, based.If center = TRUE (default), graphs show the "baseline"
distribution at the
means of (continuous) covariates, and for the reference category in case
of factors (avoiding representing "flying pigs"). If center = FALSE
the baseline distribution is at the value zero of all covariates. It is
usually a good idea to use center = FALSE in combination with
"precentering" of covariates, that is, subtracting a reference value,
ideally close to the center of the covariate distribution. In that way,
the "reference" will be the same for all subsets of the data.
coxph, risksets
 dat <- data.frame(time=  c(4, 3,1,1,2,2,3),
                status=c(1,1,1,0,1,1,0),
                x=     c(0, 2,1,1,1,0,0),
                sex=   c(0, 0,0,0,1,1,1))
 coxreg( Surv(time, status) ~ x + strata(sex), data = dat) #stratified model
 # Same as:
 rs <- risksets(Surv(dat$time, dat$status), strata = dat$sex)
 coxreg( Surv(time, status) ~ x, data = dat, rs = rs) #stratified model
 Run the code above in your browser using DataLab