trainModel,CoxModel-method {PDATK} | R Documentation

## Fit Models to the trainData in a CoxModel Object

### Description

Computes models with the `survival` package for `coxph`, `survfit`, `survdiff` as well as computes the fit p-values using `pchisq` with the chisq values from `survdiff`. Modelling data is stored in `modelData`, as well as a `data.table` with all model data merged in `modelDT`. These items are all assigned to the `models` slot.

### Usage

    ## S4 method for signature 'CoxModel'
    trainModel(object)

### Arguments

`object` | A `CoxModel` object to fit models for.

### Value

A `CoxModel` object with the results of `coxph`, `survfit` and `survdiff` in the models slot as lists where each item corresponds to the data in `modelData`. For convenience, all the model data has also been merged into a single `data.table` in the `modelDT` item of `models`.

[Package PDATK version 1.0.2 Index]