mlm2lm {LMGene}R Documentation

Linear Model converting function

Description

This function rule out the specified 'lm' class data out of the given 'c("mlm", "lm")' class data.

Usage

mlm2lm(lmobj, i)

Arguments

lmobj An object of class 'c("mlm", "lm")'.
i A specific number that indicates a 'lm' in lmobj.

Details

In case of multiple response from 'lm' function, this function can used.

Value

lmobj2 Selected 'lm' class data.

Author(s)

David Rocke and Geun-Cheol Lee

References

http://www.idav.ucdavis.edu/~dmrocke/

Examples

#library
library(Biobase)
library(LMGene)

#data
data(sample.eS)
Smpd0 <- sample.eS
# model information 
for(i in 1:length(varLabels(Smpd0))) {
  assign(paste('x', i, sep=''), as.factor(pData(Smpd0)[,i]))
}

fchar <- ''
for(i in 1:length(varLabels(Smpd0))) {
  fchar <- paste(fchar, paste('x', i, sep=''), ifelse(i<length(varLabels(Smpd0)), '+', ''), sep='')
}
fchar2 <- paste("y ~",fchar)

# run regression and ANOVAs
y <- t(as.matrix(exprs(Smpd0)))
formobj <- as.formula(fchar2)
tmp <- lm(formobj)
class(tmp)

tmp2 <- mlm2lm(tmp, i)
class(tmp2)

[Package LMGene version 1.12.0 Index]