trainModel,ClinicalModel-method {PDATK} | R Documentation

## Fit a GLM Using Clinical Predictors Specified in a `ClinicalModel` Object.

### Description

Fit a GLM Using Clinical Predictors Specified in a `ClinicalModel` Object.

### Usage

    ## S4 method for signature 'ClinicalModel'
    trainModel(
      object,
      ...,
      family = binomial(link = "logit"),
      na.action = na.exclude
    )

### Arguments

`object` | A `ClinicalModel` object, with survival data for the model in the colData slot.
`...` | Fall through parameters to the `stats::glm` function.
`family` | Argument to the family parameter of `stats::glm`. Defaults to `binomial(link='logit')`. This parameter must be named.
`na.action` | Argument to the na.action paramater of `stats::glm`. Deafults to 'na.omit', dropping rows with NA values in one or more of the formula variables.

### Value

A `ClinicalModel` object with a `glm` object in the models slot.

### Examples

    data(sampleClinicalModel)
    set.seed(getModelSeed(sampleClinicalModel))

    # Set parallelization settings
    BiocParallel::register(BiocParallel::SerialParam())

    trainedClinicalModel <- trainModel(sampleClinicalModel)

[Package PDATK version 1.2.0 Index]