data = read.table("file", header=TRUE)

R commands for PCA

Here are some R commands for PCA

pcdat = princomp(data) - It does actual job and put the results to pcdat. It will use covariance matrix

pcdat = princomp(data,cor=TRUE) - It will use correlation matrix

summary(pcdat) - It will print standard deviation and proportion of variances for each component

screeplot(pcdat) - It will plot screeplt

biplot(pcdat) or biplot.princomp(pcdat,scale=1) - It will give you biplot

loadings(pcdat) - it will give information how much each variable contribute to each component. For principal components you can ignore

loading subsection of the output from this command

pcdat$scores - It will plot scores of each observation for each variable

For further details about this and other R commands type

help.start()

 

PCA百科地址(附Matlab例子)http://baike.baidu.com/view/852194.htm#1

相关文章:

  • 2022-12-23
  • 2021-11-20
  • 2021-11-20
  • 2021-12-26
  • 2021-07-04
  • 2021-10-20
猜你喜欢
  • 2021-11-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2021-05-25
相关资源
相似解决方案