standardsPred {crmn} | R Documentation |
Predict effect for new data (or get fitted data)
Description
Predicted values for the standards
Usage
standardsPred(model, newdata, factors, lg = TRUE, ...)
Arguments
model |
result from |
newdata |
an |
factors |
the biological factors described in the pheno data
slot if |
lg |
logical indicating that the data should be log transformed |
... |
passed on to |
Details
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
\hat{X}_{IS}=X_{IS}-X_{IS}B
Value
the corrected data
Author(s)
Henning Redestig
See Also
makeX
, standardsFit
Examples
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,])
[Package crmn version 0.0.21 Index]