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/

See Also

Examples

#library
library(Biobase)
library(LMGene)

#data
data(sample.eS)
Smpd0 = sample.eS
# model information 
for(i in 1:length(Smpd0@phenoData@varLabels)){
  assign(paste('x', i, sep=''),as.factor(Smpd0@phenoData@pData[,i]))
}
  
fchar=''
for(i in 1:length(Smpd0@phenoData@varLabels)){
  fchar=paste(fchar, paste('x', i, sep=''), ifelse(i<length(Smpd0@phenoData@varLabels), '+', ''), sep='')
}
fchar2 <- paste("y ~",fchar)
#
# run regression and anovas
y <- t(as.matrix(Smpd0@exprs))
formobj <- as.formula(fchar2)
tmp <- lm(formobj)
class(tmp)

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


[Package LMGene version 1.6.0 Index]