rowlmMatVec: Fit a linear model with rows of mat and vec, possibly adding...

Description Usage Arguments Value

Description

Fit a linear model with rows of mat and vec, possibly adding an adjustment variable (adj)

Usage

1
2
rowlmMatVec(mat, vec, adj, matIsX = TRUE, collapse = TRUE,
  parallel = FALSE, core = 12)

Arguments

mat

a matrix

vec

a vector, length of ncol(mat)

adj

a vector for adjustment variable

matIsX

by default, mat rows are continuous (i.e. expr) and vec is categorical response; but for CN data where mat is categorical and the response might be continuous or not. in this case, we want lm(y~x) treats rows of mat as y and vec as x. This can be achieved by specifying matIsX=FALSE that makes rows of mat as the response variable

collapse

when vec is non-numeric which will be treated as factor, there are multiple coefs for different levels. We thus need to summarize them into a scaler (by mean). if collapse=FALSE, all coefs will be returned.

core

number of cores to use for parallel

adj

this can be a vector or a data frame that contains multiple variables to be adjusted. It needs to have nrow=length(vec).—-> now demands a 1 column for easy handling

Value

a data frame


nickytong/GenAnalysis documentation built on July 20, 2019, 8:57 a.m.