在R
編程語言和包pcaPP
我有這樣的代碼:顯示和報告功能輸出
# multivariate data with outliers
library(mvtnorm)
library(pcaPP)
x <- rbind(rmvnorm(200, rep(0, 6), diag(c(5, rep(1,5)))),
rmvnorm( 15, c(0, rep(20, 5)), diag(rep(1, 6))))
# Here we calculate the principal components with PCAgrid
pc <- PCAproj(x)
下面是PCAproj
函數的輸出值的文檔:
The function returns a list of class '"princomp"', i.e. a list similar to the output of the function 'princomp'. sdev: the (robust) standard deviations of the principal components. loadings: the matrix of variable loadings (i.e., a matrix whose columns contain the eigen- vectors). This is of class "loadings": see loadings for its print method. center: the means that were subtracted. scale: the scalings applied to each variable. n.obs: the number of observations. scores: if 'scores = TRUE', the scores of the supplied data on the principal components. call: the matched call.
如何調用PCAproj
的其他輸出,如loadings
和sdev
並在R-studio中報告?
您可能會通過執行'str(pc)'來檢查'pc'的結構, –