{
data(stemHypoxia)
##Just to make a balanced dataset in the Fisher sense (2 samples per
## time*oxygen levels)
design<-design[design$time %in% c(0.5,1,5) & design$oxygen %in% c(1,5,21), ]
design$time<-as.factor(design$time)
design$oxygen<-as.factor(design$oxygen)
rownames(M)<-M[, 1]
#Keeping appropriate samples only
M<-M[, colnames(M) %in% design$samplename]
##ANOVA decomposition
fit<-lmdme(model=~time+oxygen+time:oxygen, data=M, design=design)
##Just a copy of the same fit object and to perform analysis on those
##subjects/genes where at least one interaction coefficient is statistically
##different from zero (F-test on the coefficients).
asca<-fit
apca<-fit
id<-F.p.values(fit, term="time:oxygen")<0.001
##ASCA and APCA decomposition for every available term.
decomposition(asca, decomposition="pca", subset=id, scale="row")
decomposition(apca, decomposition="pca", subset=id, scale="row",
type="residual")
##Let's get the components for asca/apca decomposed objects
asca<-components(asca)
apca<-components(apca)
##Now let's try the PLSR decomposition for residuals and coefficients
plsr.residuals<-fit
plsr.coefficients<-fit
decomposition(plsr.coefficients, decomposition="plsr", subset=id,
scale="row")
decomposition(plsr.residuals, decomposition="plsr", subset=id, scale="row",
type="residual")
##Obtain the coefficients for decomposed plsr objects
##(coefficients/residuals)
plsr.coefficients<-components(plsr.coefficients)
plsr.residuals <- components(plsr.residuals)
}
Run the code above in your browser using DataLab