fitLinearModel {MSstatsPTM}R Documentation

Fit linear model

Description

fitLinearModel fits and returns a linear model with log2inty as response, and group and possibly batch as fixed effects.

Usage

fitLinearModel(df, fctBatch = FALSE)

Arguments

df

A data frame with columns log2inty, group, and batch for one PTM site.

fctBatch

A logical. TRUE considers batch effect, FALSE otherwise. Default is FALSE.

Value

An lm model object.

Examples

x1 <- data.frame(
    batch=rep(c("1", "2"), each=4),
    group=rep(c("1", "2"), 4),
    log2inty=rep(c(10, 12), 4) + rnorm(8)
)
fitLinearModel(x1, fctBatch=TRUE)

x2 <- data.frame(
    group=rep(c("1", "2"), 3),
    log2inty=rep(c(10, 12), 3) + rnorm(6)
)
fitLinearModel(x2)


[Package MSstatsPTM version 1.0.0 Index]