standardsPred {crmn} | R Documentation |
There is often unwanted variation in among the labeled internal standards which is related to the experimental factors due to overlapping peaks etc. This predicts this effect given a model of the overlapping variance. The prediction is given by XhatIS=XIS-XIS*B
standardsPred(model, newdata, factors, lg=TRUE, ...)
model |
result from standardsFit |
newdata |
an ExpressionSet or matrix with new data (or the data
used to fit the model to get the fitted data) |
factors |
the biological factors described in the pheno data slot
if object is an ExpressionSet or a design matrix if
object is a matrix . |
lg |
logical indicating that the data should be log transformed |
... |
passed on to standards and analytes |
the corrected data
Henning Redestig henning@psc.riken.jp
makeX
, standardsFit
data(mix) fullFit <- standardsFit(mix, "type", ncomp=3) sfit <- standardsFit(mix[,-1], "type", ncomp=3) pred <- standardsPred(sfit, mix[,1], "type") cor(scores(sfit$fit$pc)[1,], scores(fullFit$fit$pc)[1,]) ## could just as well have been done as Y <- exprs(mix) G <- model.matrix(~-1+mix$type) isIS <- fData(mix)$tag == 'IS' fullFit <- standardsFit(Y, G, ncomp=3, standards=isIS) sfit <- standardsFit(Y[,-1], G[-1,], ncomp=3, standards=isIS) pred <- standardsPred(sfit, Y[,1,drop=FALSE], G[1,,drop=FALSE], standards=isIS) cor(scores(sfit$fit$pc)[1,], scores(fullFit$fit$pc)[1,])