R: predicted events

predict {survMisc} | R Documentation

## predicted events

### Description

predicted events

### Usage

    ## S3 method for class 'ten'
    predict(object, ..., eMP = TRUE, reCalc = FALSE)

### Arguments

`object` | An object of class `ten`.
`eMP` | Add column(s) indicating events minus predicted.
`...` | Additional arguments (not implemented).
`reCalc` | Recalcuate the values? If `reCalc=FALSE` (the default) and the `ten` object already has the calculated values stored as an `attribute`, the value of the `attribute` is returned directly.

### Details

With K covariate groups, We use ncg[i, k], the number at risk for group k, to calculate the number of expected events:

P[i, k] = e[i] * ncg[i, k] / n[i]

### Value

An `attribute`, `pred` is added to `object`:

`t` | Times with at least one observation
`P_` | predicted number of events

And if `eMP==TRUE` (the default):

`eMP_` | events minus predicted

The names of the `object`'s covariate groups are used to make the suffixes of the column names (i.e. after the `_` character).

### Note

There is a predicted value for each unique time, for each covariate group.

### See Also

?survival::predict.coxph methods("predict")

### Examples

    ## K&M. Example 7.2, Table 7.2, pp 209-210.
    data("kidney", package="KMsurv")
    k1 <- ten(Surv(time=time, event=delta) ~ type, data=kidney)
    predict(k1)
    predict(asWide(k1))
    stopifnot(predict(asWide(k1))[, sum(eMP_1 + eMP_2)] <=
              .Machine$double.neg.eps)
    ## Three covariate groups
    ## K&M. Example 7.4, pp 212-214.
    data("bmt", package="KMsurv")
    b1 <- ten(Surv(time=t2, event=d3) ~ group, data=bmt)
    predict(b1)
    ## one group only
    predict(ten(Surv(time=t2, event=d3) ~ 1, data=bmt))

[Package survMisc version 0.5.4 Index]