getContrast,StatModel-method {msqrob2} | R Documentation

## Methods for StatModel class

### Description

Methods for StatModel class

getContrast(object, L)

  to calculate contrasts of the model parameters

varContrast(object, L)

  to calculate the variance-covariance matrix of the contrasts

### Usage

    ## S4 method for signature 'StatModel'
    getContrast(object, L)

    ## S4 method for signature 'StatModel'
    varContrast(object, L)

### Arguments

`object` | A list with elements of the class `StatModel` that are estimated using the `msqrob` function
`L` | contrast `numeric` matrix specifying one or more contrasts of the linear model coefficients to be tested equal to zero. The rownames of the matrix should be equal to the names of parameters of the model.

### Value

A matrix with the calculated contrasts or variance-covariance matrix of contrasts

### Examples

    data(pe)
    # Aggregate peptide intensities in protein expression values
    pe <- aggregateFeatures(pe, i = "peptide", fcol = "Proteins", name = "protein")

    # Fit msqrob model
    pe <- msqrob(pe, i = "protein", formula = ~condition)

    # Define contrast
    getCoef(rowData(pe[["protein"]])$msqrobModels[[1]])
    # Define contrast for log2 fold change between condition c and condition b:
    L <- makeContrast("conditionc - conditionb=0", c("conditionb", "conditionc"))

    getContrast(rowData(pe[["protein"]])$msqrobModels[[1]], L)
    varContrast(rowData(pe[["protein"]])$msqrobModels[[1]], L)

[Package msqrob2 version 1.0.0 Index]