####多元统计分析####
####主成分分析####
princomp(formula, data = NULL, subset, na.action, ...)
princomp(x, cor = FALSE, scores = TRUE, covmat = NULL,
subset = rep_len(TRUE, nrow(as.matrix(x))), fix_sign = TRUE, ...)
#cor = FALSE,表示用样本的协方差阵S做主成分
#cor = T,表示用样本的相关阵R做主成分
####因子分析####
factanal(x, factors, data = NULL, covmat = NULL, n.obs = NA,
subset, na.action, start = NULL,
scores = c("none", "regression", "Bartlett"),
rotation = "varimax", control = NULL, ...)
#factors表示因子个数
####Fisher判别分析####
library(MASS)
lda(formula, data, ..., subset, na.action)
####计算距离####
dist(x, method = "euclidean", diag = FALSE, upper = FALSE, p = 2)
#"euclidean", "maximum", "manhattan",
#"canberra", "binary", "minkowski"
# average Linkage 类平均法
# centroid method 重心法
# median method 中间距离法
# complete method 最长距离法
# single method 最短距离法
# ward method 离差平方和法
# density method 密度估计法
####聚类分析####
hclust(d, method = "complete", members = NULL)
#d是“dist”构成的距离结构,method是系统聚类的方法
####典型相关分析####
cancor(x, y, xcenter = TRUE, ycenter = TRUE)
#xcenter = TRUE, ycenter = TRUE表示数据是否中心化处理
####对应分析####
library(MASS)
corresp(x, nf = 1, ...)