R: Fit a mixed effects Cox model

coxme {coxme} | R Documentation

## Fit a mixed effects Cox model

### Description

Fit a Cox model containing mixed (random and fixed) effects. Assume a Gaussian distribution for the random effects.

### Usage

    coxme(formula, data, weights, subset, na.action, init, control,
    ties = c("efron", "breslow"),
    varlist, vfixed, vinit,  x = FALSE, y = TRUE,
    refine.n = 0, random, fixed, variance, ...)

### Arguments

`formula` | a two-sided formula with a survival object as the left hand side of a `~` operator and the fixed and random effects on the right.
`data` | an optional data frame containing the variables named in the `formula`.
`subset, weights, na.action` | further model specifications arguments as in `lm`; see there for details.
`init` | optional initial values for the fixed effects.
`control` | optional list of control options. See `coxme.control` for details.
`ties` | method for handling exact ties in the survival time.
`varlist` | the variance family to be used for each random term. If there are multiple terms it will be a list of variance functions. The default is `coxmeFull`. Alternatively it can be a list of matrices, in which case the `coxmeMlist` function is used.
`vfixed` | optional named list or vector used to fix the value of one or more of the variance terms at a constant.
`vinit` | optional named list or vector giving suggested starting values for the variance.
`x` | if TRUE the X matrix (fixed effects) is included in the output object
`y` | if TRUE the y variable (survival time) is included in the output object
`refine.n` | number of samples to be used in a monte-carlo estimate of possible error in the log-likelihood of the fitted model due to inadequacy of the Laplace approximation.
`fixed, random, variance` | In the preliminary version of `coxme` the fixed and random effects were separate arguments. These arguments are included for backwards compatability, but are depreciated. The variance argument is a depreciated alias for vfixed.
`...` | any other arguments are passed forward to `coxme.control`.

### Value

An object of class `coxme`.

### Author(s)

Terry Therneau

### References

S Ripatti and J Palmgren, Estimation of multivariate frailty models using penalized partial likelihood, Biometrics, 56:1016-1022, 2000.

T Therneau, P Grambsch and VS Pankratz, Penalized survival models and frailty, J Computational and Graphical Statistics, 12:156-175, 2003.

### See Also

`coxmeFull`, `coxmeMlist`, `coxme.object`

### Examples

    # A non-significant institution effect
    fit1 <- coxph(Surv(time, status) ~ ph.ecog + age, data=lung,
                  subset=(!is.na(inst)))
    fit2 <- coxme(Surv(time, status) ~ ph.ecog + age + (1|inst), lung)
    anova(fit1, fit2)

    # Shrinkage effects (equivalent to ridge regression)
    temp <- with(lung, scale(cbind(age, wt.loss, meal.cal)))
    rfit <- coxme(Surv(time, status) ~ ph.ecog + (temp | 1), data=lung)

[Package coxme version 2.2-7 Index]