Biomedical Engineering Reference
In-Depth Information
segments(-plotrangeX, 0, plotrangeX, 0, col='grey')
segments(0, -plotrangeY, 0, plotrangeY, col='grey')
text (R$'p1', R$'p2', labels = rownames(R),
pos = 4,
offset = 0.5,
cex=1)
segments(-plotrangeX, 0, plotrangeX, 0, col='grey')
segments(0, -plotrangeY, 0, plotrangeY, col='grey')
text (R$'p1', R$'p2', labels = rownames(R),
pos = 4,
offset = 0.5,
cex=1)
Finally, the R2 (Variance explained) and the Q2 (Predictive variance) are
calculated via the following R code.
#-------------------------------------------
# PCA R2 Q2 Node (Snippet Node)
#-------------------------------------------
require(pcaMethods)
X=as.matrix(R)
results=pca(X, method='nipals', centre=FALSE, nPcs=3)
Q=Q2(results,X,fold=7,nruncv=1) @lculate Q2
R_2=c(results@R2cum[1],results@R2cum[2],results@R2cum[2])
Q_2= c(Q[1],Q[2],Q[3])
model_stats=cbind(R_2,Q_2) #R2 and Q2 together - concatenate
R<-model_stats
#-------------------------------------------
# PCA R2 Q2 Node (Snippet Node)
#-------------------------------------------
require(pcaMethods)
X=as.matrix(R)
results=pca(X, method='nipals', centre=FALSE, nPcs=3)
Q=Q2(results,X,fold=7,nruncv=1) @lculate Q2
R_2=c(results@R2cum[1],results@R2cum[2],results@R2cum[2])
Q_2= c(Q[1],Q[2],Q[3])
model_stats=cbind(R_2,Q_2) #R2 and Q2 together - concatenate
R<-model_stats
#-------------------------------------------
# R2 and Q2 barchart (RView Node)
#-------------------------------------------
R = as.matrix(R)
#-------------------------------------------
# R2 and Q2 barchart (RView Node)
#-------------------------------------------
R = as.matrix(R)
model_stats= c(R[1,1],R[1,2],R[2,1],R[2,2],R[3,1],R[3,2])
barplot(model_stats,
ylab= 'Value',
xlab='Component',
beside=TRUE,
main='R2 (fi t) and Q2 (prediction)',
col=c('lightgreen','lightblue'),
ylim = c(0,1),
space=0)
axis(1, at=c(1.0,3.0,5.0), lab=c('1','2','3'))
model_stats= c(R[1,1],R[1,2],R[2,1],R[2,2],R[3,1],R[3,2])
barplot(model_stats,
ylab= 'Value',
xlab='Component',
beside=TRUE,
main='R2 (fi t) and Q2 (prediction)',
col=c('lightgreen','lightblue'),
ylim = c(0,1),
space=0)
axis(1, at=c(1.0,3.0,5.0), lab=c('1','2','3'))
￿ ￿ ￿ ￿ ￿
legend(0.2, 1, c('R2','Q2'),
cex=1.5,
col=c('lightgreen','lightblue'),
pch=15)
legend(0.2, 1, c('R2','Q2'),
cex=1.5,
col=c('lightgreen','lightblue'),
pch=15)
The output of the R View nodes may be seen by right clicking the node
and selecting View: R View (Figure 4.16(a)). The PCA scores plot
(Figure 4.16(B)) is shown in the output from the fi rst RView node. The
plot shows the improved clustering of the quality control samples after
the internal standard normalisation (the cluster of triangles on the right
 
Search WWH ::




Custom Search