StatModel-class {msqrob2} | R Documentation

## The StatModel class for msqrob

### Description

The `StatModel` class contains a statistical model as applied on a feature.

Models are created by the dedicated user-level functions (`msqrob()`, `mqrobAggregate()`) or manually, using the `StatModel()` constructor. In the former case, each quantitative feature is assigned its statistical model and the models are stored as a variable in a `DataFrame` object, as illustred in the example below.

Function for constructing a new `StatModel` object.

### Usage

    ## S4 method for signature 'StatModel'
    show(object)

    StatModel(
      type = "fitError",
      params = list(),
      varPosterior = NA_real_,
      dfPosterior = NA_real_
    )

### Arguments

`object` | `StatModel` object
`type` | default set to fit-error, can be a "lm", "rlm" (robust lm with M estimation), "lmer" (when mixed models or ridge regression is adopted), "quasibinomial" (when peptide counts are fitted)
`params` | A list containing the parameters of the fitted model
`varPosterior` | Numeric, posterior variance, default is NA
`dfPosterior` | Numeric, posterior degrees of freedom, default is NA

### Value

A StatModel object

### Slots

`type`

  `character(1)` defining type of the used model. Default is `"fitError"`, i.e. a error model. Other include `"lm"`, `"rlm"`, ...

`params`

  A `list()` containing information of the used model.

`varPosterior`

  `numeric()` of posterior variance.

`dfPosterior`

  `numeric()` of posterior degrees of freedom.

### Author(s)

Oliver M. Crook, Laurent Gatto, Lieven Clement

### Examples

    ## A fully specified dummy model
    myModel <- StatModel(
        type = "rlm",
        params = list(x = 3, y = 7, b = 4),
        varPosterior = c(0.1, 0.2, 0.3),
        dfPosterior = c(6, 7, 8)
    )
    myModel

    ## A collection of models stored as a variable in a DataFrame
    mod1 <- StatModel(type = "rlm")
    mod2 <- StatModel(type = "lm")
    df <- DataFrame(x = 1:2)
    df$mods <- c(mod1, mod2)
    df
    # TODO

[Package msqrob2 version 1.2.0 Index]