Proportion of Variance 0.8393 0.08932 0.05296 0.01844
Cumulative Proportion 0.8393 0.92860 0.98156 1.00000
plot(lh.pca, type ="l")
predict(lh.pca,
newdata =tail(na.omit(log.lh,2)))
PC1 PC2 PC3 PC4
450 -0.4271374 0.32820602 -0.36821424 0.003225707
458 -2.2396492 -0.45685837 -0.15879184 0.195294075
466 -0.3954699 0.17690207 0.11668851 -0.061863425
475 -0.9588797 -0.02340739 0.07678242 -0.186083713
484 -0.9275021 -0.32335662 0.26334138 -0.183940408
493 -1.5313185 0.46210774 -0.41899155 -0.045873086
biplot(lh.pca)
画出一个类似于下图的图,横坐标是response variable,纵坐标是Principal Com ponent。
pp=prcomp(na.omit(log.lh))
x=lh.dose[as.numeric(names(predict(lh.pca,
newdata =na.omit(log.lh,2) )[,1]))]
y=predict(lh.pca,
newdata =na.omit(log.lh,2) )[,1]
data=data.frame(x,y)
aggregate(y ~x, data = data, mean)
x y
1 1 Gy 0.46637350
2 2 Gy 0.63214810
3 4 Gy -0.05234262
4 5.
5 Gy -0.92889378
5 Sham 0.35652766
aggregate(y ~x, data = data, sd)
x y
1 1 Gy 0.2975531
2 2 Gy 0.3364273
3 4 Gy 0.5905769