mlm2lm {LMGene} | R Documentation |
This function rule out the specified 'lm' class data out of the given 'c("mlm", "lm")' class data.
mlm2lm(lmobj, i)
lmobj |
An object of class 'c("mlm", "lm")' |
i |
A specific number that indicates a 'lm' in lmobj |
In case of multiple response from 'lm' function, this function can used.
lmobj2 |
Selected 'lm' class data |
David Rocke and Geun-Cheol Lee
#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)