Rの基本パッケージ中の多変量解析関数一覧
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
// 間瀬 2004.0912
COLOR(red){SIZE(18){R の多変量解析オブジェクトの簡易説明}}
R の基本パッケージ stats には、階層的クラスタリング、主成...
#contents
~
~
* クラスタリングと樹状図 [#t3e8c60e]
** クラス "hclust" のオブジェクトへの変換 as.hclust() [#s...
他のクラスタリング関数の出力オブジェクトを、クラス "hclus...
as.hclust(x, ...)
** 樹状図のクラスタの周りに枠を描く rect.hclust() [#pd4fd...
樹状図のクラスタの周りに枠を描く。
rect.hclust(tree, k = NULL, which = NULL, x = NULL, h = ...
border = 2, cluster = NULL)
** 樹状図を並べ換える reorder(x, wts, ...) [#ua859c78]
樹状図を並べ換える。
reorder(x, ...)
## クラス "dendrogram" に対するメソッド
reorder(x, wts, ...)
** 階層型クラスタリングのための共表型距離 cophenetic() [...
階層型クラスタリングのための共表型距離を計算する関数であ...
cophenetic(x)
** クラスタリング木の分割 cutree() [#c7adad75]
hclust() の出力であるような、木を、必要なグループ数、もし...
cutree(tree, k = NULL, h = NULL)
** 樹状図に対するメソッド [#g812740b]
hclust() の出力であるような木を、必要なグループ数、もしく...
as.dendrogram(object, ...)
plot(x, type = c("rectangle", "triangle"),
center = FALSE, edge.root = !is.null(attr(x,"edgete...
nodePar = NULL, edgePar = list(), xlab = "", ylab =...
horiz = FALSE, frame.plot = FALSE, ...)
cut(x, h, ...)
print(x, digits, ...)
rev(x)
str(object, max.level = 0, digits.d = 3,
give.attr = FALSE, wid = getOption("width"),
nest.lev = 0, indent.str = "", ...)
** 階層的クラスタリング hclust(), plclust() [#me38f482]
非類似性のセットに基づく階層的クラスタ解析と、それを解析...
hclust(d, method = "complete", members=NULL)
クラス 'hclust' に対するプロットメソッド
plot(x, labels = NULL, hang = 0.1,
axes = TRUE, frame.plot = FALSE, ann = TRUE,
main = "Cluster Dendrogram",
sub = NULL, xlab = NULL, ylab = "Height", ...)
plclust(tree, hang = 0.1, unit = FALSE, level = FALSE, h...
square = TRUE, labels = NULL, plot. = TRUE,
axes = TRUE, frame.plot = FALSE, ann = TRUE,
main = "", sub = NULL, xlab = NULL, ylab = "Heig...
** ヒートマップ heatmap() [#caf48f4e]
ヒートマップは疑似的なカラーイメージ(基本的に image(t(x))...
heatmap(x, Rowv=NULL, Colv=if(symm)"Rowv" else NULL, dis...
hclustfun = hclust, add.expr, symm = FALSE,
revC = identical(Colv, "Rowv"),
scale=c("row", "column", "none"), na.rm = TRUE,
margins = c(5, 5), ColSideColors, RowSideColors,
cexRow = 0.2 + 1/log10(nr), cexCol = 0.2 + 1/log...
labRow = NULL, labCol = NULL, main = NULL, xlab ...
ylab = NULL, verbose = getOption("verbose"), ...)
** 樹状図のインタラクティブな操作 identify.hclust() [#ndf...
identify.hclust() は、第一マウスボタンが押された時の、グ...
identify.hclust(x, FUN = NULL, N = 20, MAXCLUSTER = 20,
DEV.FUN = NULL, ...)
** k-means 法によるクラスタリング kmeans() [#f924c903]
データ行列に対し、k-means 法によるクラスタリングを実行す...
kmeans(x, centers, iter.max = 10)
** 樹状図中の葉の順序を得る order.dendrogram() [#h2903750]
樹状図の葉の順序(添字)を返す。これは、任意の追加データの...
order.dendrogram(x)
* 主成分分析 [#s3a516d9]
** 主成分分析 prcomp() [#f9670e78]
与えられたデータ行列に主成分分析を実行し、結果をクラス "p...
prcomp(x, retx = TRUE, center = TRUE, scale. = FALSE, to...
** 主成分分析 princomp() [#s483fe89]
与えられた数値データ行列に対し主成分分析を行い、結果をク...
## クラス formula に対するメソッド
princomp(formula, data = NULL, subset, na.action, ...)
## 既定メソッド
princomp(x, cor = FALSE, scores = TRUE, covmat = NULL,
subset = rep(TRUE, nrow(as.matrix(x))), ...)
** 主成分分析用のバイプロット biplot() [#uaec1218]
princomp もしくは prcomp() 関数の出力から、
狭義のバイプロットグラフを描く。
biplot(x, choices = 1:2, scale = 1, pc.biplot = FALSE, ....
** 主成分の分散のプロット screeplot() [#lf76d7d2]
//関数{は主成分分析の screeplot("scree" とは "小石" を意...
主成分分析の screeplot("scree" とは "がれ","がれ場" を意...
screeplot(x, npcs = min(10, length(x$sdev)),
type = c("barplot", "lines"),
main = deparse(substitute(x)), ...)
** 主成分分析結果の要約 [#s2dc7ebb]
クラス "princomp" のオブジェクトの summary メソッドである。
## クラス princomp に対するメソッド
summary(object, loadings = FALSE, cutoff = 0.1, ...)
## クラス summary.princomp に対するメソッド
print(x, digits=3, loadings=x$print.loadings, cutoff=x$c...
* 因子分析 [#q530f25c]
** 因子分析 factanal() [#m5e4cbbd]
データ行列の共分散行列に対し、最尤法による因子分析を実行...
-[[Rによる因子分析法の比較:http://d.hatena.ne.jp/kosugitt...
factanal(x, factors, data = NULL, covmat = NULL, n.obs =...
subset, na.action, start = NULL,
scores = c("none", "regression", "Bartlett"),
rotation = "varimax", control = NULL, ...)
** 因子分析用の回転 varimax(), promax() [#pb866ac2]
因子分析用の回転メソッド。
varimax(x, normalize = TRUE, eps = 1e-5)
promax(x, m = 4)
** 因子分析負荷量の出力 loadings() [#g83df61c]
因子分析に於ける負荷量(loading)を出力する。
loadings(x)
## クラス loadings に対する print メソッド
print(x, digits = 3, cutoff = 0.1, sort = FALSE, ...)
## クラス factanal に対する print メソッド
print(x, digits = 3, ...)
**因子得点 [#sd166bd0]
* 正準相関、canonical correlation [#cbd3ebc0]
** 正準相関 cancor() [#s11a612d]
二つのデータ行列間の正準相関係数を計算する。
cancor(x, y, xcenter = TRUE, ycenter = TRUE)
* 多次元尺度法、MDS (multidimensional scaling) [#z1018969]
** 古典的(距離)多次元尺度法 cmdscale() [#zbb71fc7]
データ行列の多次元尺度法用の関数である。principal coordin...
cmdscale(d, k = 2, eig = FALSE, add = FALSE, x.ret = FAL...
** Kruskal の非計量的多次元尺度法 isoMDS [#u9f8eed3]
** 非計量的多次元尺度法 sammon [#b4e3090f]
* ユーティリティ関数 [#rdaba37f]
** 距離行列を計算する dist() [#g942fbc4]
この関数はデータ行列の各行間の距離を、指定された各種距離...
dist(x, method = "euclidean", diag = FALSE, upper = FALSE)
as.dist(m, diag = FALSE, upper = FALSE)
## クラス "dist" に対するメソッド
print(x, diag = NULL, upper = NULL, digits = getOption("...
justify = "none", right = TRUE, ...)
## クラス "dist" に対するメソッド
as.matrix(x)
** 多変量データのバイプロット biplot() [#mec14ff7]
現在のグラフィックスデバイスに多変量データのバイプロット...
biplot(x, y, var.axes = TRUE, col, cex = rep(par("cex"),...
xlabs = NULL, ylabs = NULL, expand = 1, ...
xlim = NULL, ylim = NULL, arrow.len = 0.1, ...
main = NULL, sub = NULL, xlab = NULL, ylab = NULL...
* 判別分析 (discriminant analysis) (MASS パッケージ中) [#...
今一つの多変量解析の代表的古典的手法である「判別分析」(di...
** 線形判別関数 lda() [#g001506e]
線形判別分析 (linear discriminant analysis) を行う。この...
lda(x, grouping, prior = proportions, tol = 1.0e-4,
method, CV = FALSE, nu, ...)
## クラス "formula" 用
lda(formula, data, ..., subset, na.action)
## クラス "data.frame" 用
lda(x, ...)
## クラス "matrix" 用
lda(x, grouping, ..., subset, na.action = na.fail)
** 線形判別分析による予測 predict() [#z2ce2f12]
多変量観測値を lda() に連動して判別する。そして、データを...
## クラス "lda" 用
predict(object, newdata, prior = object$prior, dimen,
method = c("plug-in", "predictive", "debiased"),...
** 二次判別関数 qda() [#lf3ea005]
qda() は二次関数(Maharanobis 距離による楕円状の判別領域を...
(quadratic discriminant analysis) を行う。
QR 分解を使い、もしグループ内共分散行列が特定のグループに...
## 既定手法
qda(x, grouping, prior = proportions,
method, CV = FALSE, nu, ...)
## クラス "formula" 用
qda(formula, data, ..., subset, na.action)
## クラス "data.frame" 用
qda(x, ...)
## クラス "matrix" 用
qda(x, grouping, ..., subset, na.action = na.fail)
** 二次判別関数による予測 [#qca2af88]
この関数はクラス "qda" に対する総称的関数 predict() の一...
## S3 method for class 'qda':
predict(object, newdata, prior = object$prior,
method = c("plug-in", "predictive", "debiased", ...
* 多変量解析アドオンパッケージ multiv 中のオブジェクト [#...
以下は library(help=multiv) で得られる multiv パッケージ...
なお、パッケージバンドル VR 中の推奨パッケージ MASS, clas...
ca() 対応分析 (correspondence analysis)。多変量デ...
最大の慣性(inertia)を持ち、二番目の座標は最...
最大の慣性を持ち、等々の基準で新しい座標系求...
各行と列は関連する質量(mass)を持ち(行と列の...
ユークリッド距離にとって代わる。入力データを...
重要であり、これが主成分分析の入力データ変換...
bea() 結合エネルギアルゴリズム(bond energy algorit...
近似度を最大化するように入れ換える
flou() (3元分類)ファジーコーディング。ベクトルの単...
ベクトル中の各値は 1 (67 番目のクォンタイル...
0 と 1 の間で線形補間 (33, 67 番目のクォンタ...
hierclust() 階層的クラスタリング。hclust() の代替関数
logique() 論理値コーディング。中央値以上、未満の値をそ...
members() データの各クラスターへの所属関係を表示
終了行:
// 間瀬 2004.0912
COLOR(red){SIZE(18){R の多変量解析オブジェクトの簡易説明}}
R の基本パッケージ stats には、階層的クラスタリング、主成...
#contents
~
~
* クラスタリングと樹状図 [#t3e8c60e]
** クラス "hclust" のオブジェクトへの変換 as.hclust() [#s...
他のクラスタリング関数の出力オブジェクトを、クラス "hclus...
as.hclust(x, ...)
** 樹状図のクラスタの周りに枠を描く rect.hclust() [#pd4fd...
樹状図のクラスタの周りに枠を描く。
rect.hclust(tree, k = NULL, which = NULL, x = NULL, h = ...
border = 2, cluster = NULL)
** 樹状図を並べ換える reorder(x, wts, ...) [#ua859c78]
樹状図を並べ換える。
reorder(x, ...)
## クラス "dendrogram" に対するメソッド
reorder(x, wts, ...)
** 階層型クラスタリングのための共表型距離 cophenetic() [...
階層型クラスタリングのための共表型距離を計算する関数であ...
cophenetic(x)
** クラスタリング木の分割 cutree() [#c7adad75]
hclust() の出力であるような、木を、必要なグループ数、もし...
cutree(tree, k = NULL, h = NULL)
** 樹状図に対するメソッド [#g812740b]
hclust() の出力であるような木を、必要なグループ数、もしく...
as.dendrogram(object, ...)
plot(x, type = c("rectangle", "triangle"),
center = FALSE, edge.root = !is.null(attr(x,"edgete...
nodePar = NULL, edgePar = list(), xlab = "", ylab =...
horiz = FALSE, frame.plot = FALSE, ...)
cut(x, h, ...)
print(x, digits, ...)
rev(x)
str(object, max.level = 0, digits.d = 3,
give.attr = FALSE, wid = getOption("width"),
nest.lev = 0, indent.str = "", ...)
** 階層的クラスタリング hclust(), plclust() [#me38f482]
非類似性のセットに基づく階層的クラスタ解析と、それを解析...
hclust(d, method = "complete", members=NULL)
クラス 'hclust' に対するプロットメソッド
plot(x, labels = NULL, hang = 0.1,
axes = TRUE, frame.plot = FALSE, ann = TRUE,
main = "Cluster Dendrogram",
sub = NULL, xlab = NULL, ylab = "Height", ...)
plclust(tree, hang = 0.1, unit = FALSE, level = FALSE, h...
square = TRUE, labels = NULL, plot. = TRUE,
axes = TRUE, frame.plot = FALSE, ann = TRUE,
main = "", sub = NULL, xlab = NULL, ylab = "Heig...
** ヒートマップ heatmap() [#caf48f4e]
ヒートマップは疑似的なカラーイメージ(基本的に image(t(x))...
heatmap(x, Rowv=NULL, Colv=if(symm)"Rowv" else NULL, dis...
hclustfun = hclust, add.expr, symm = FALSE,
revC = identical(Colv, "Rowv"),
scale=c("row", "column", "none"), na.rm = TRUE,
margins = c(5, 5), ColSideColors, RowSideColors,
cexRow = 0.2 + 1/log10(nr), cexCol = 0.2 + 1/log...
labRow = NULL, labCol = NULL, main = NULL, xlab ...
ylab = NULL, verbose = getOption("verbose"), ...)
** 樹状図のインタラクティブな操作 identify.hclust() [#ndf...
identify.hclust() は、第一マウスボタンが押された時の、グ...
identify.hclust(x, FUN = NULL, N = 20, MAXCLUSTER = 20,
DEV.FUN = NULL, ...)
** k-means 法によるクラスタリング kmeans() [#f924c903]
データ行列に対し、k-means 法によるクラスタリングを実行す...
kmeans(x, centers, iter.max = 10)
** 樹状図中の葉の順序を得る order.dendrogram() [#h2903750]
樹状図の葉の順序(添字)を返す。これは、任意の追加データの...
order.dendrogram(x)
* 主成分分析 [#s3a516d9]
** 主成分分析 prcomp() [#f9670e78]
与えられたデータ行列に主成分分析を実行し、結果をクラス "p...
prcomp(x, retx = TRUE, center = TRUE, scale. = FALSE, to...
** 主成分分析 princomp() [#s483fe89]
与えられた数値データ行列に対し主成分分析を行い、結果をク...
## クラス formula に対するメソッド
princomp(formula, data = NULL, subset, na.action, ...)
## 既定メソッド
princomp(x, cor = FALSE, scores = TRUE, covmat = NULL,
subset = rep(TRUE, nrow(as.matrix(x))), ...)
** 主成分分析用のバイプロット biplot() [#uaec1218]
princomp もしくは prcomp() 関数の出力から、
狭義のバイプロットグラフを描く。
biplot(x, choices = 1:2, scale = 1, pc.biplot = FALSE, ....
** 主成分の分散のプロット screeplot() [#lf76d7d2]
//関数{は主成分分析の screeplot("scree" とは "小石" を意...
主成分分析の screeplot("scree" とは "がれ","がれ場" を意...
screeplot(x, npcs = min(10, length(x$sdev)),
type = c("barplot", "lines"),
main = deparse(substitute(x)), ...)
** 主成分分析結果の要約 [#s2dc7ebb]
クラス "princomp" のオブジェクトの summary メソッドである。
## クラス princomp に対するメソッド
summary(object, loadings = FALSE, cutoff = 0.1, ...)
## クラス summary.princomp に対するメソッド
print(x, digits=3, loadings=x$print.loadings, cutoff=x$c...
* 因子分析 [#q530f25c]
** 因子分析 factanal() [#m5e4cbbd]
データ行列の共分散行列に対し、最尤法による因子分析を実行...
-[[Rによる因子分析法の比較:http://d.hatena.ne.jp/kosugitt...
factanal(x, factors, data = NULL, covmat = NULL, n.obs =...
subset, na.action, start = NULL,
scores = c("none", "regression", "Bartlett"),
rotation = "varimax", control = NULL, ...)
** 因子分析用の回転 varimax(), promax() [#pb866ac2]
因子分析用の回転メソッド。
varimax(x, normalize = TRUE, eps = 1e-5)
promax(x, m = 4)
** 因子分析負荷量の出力 loadings() [#g83df61c]
因子分析に於ける負荷量(loading)を出力する。
loadings(x)
## クラス loadings に対する print メソッド
print(x, digits = 3, cutoff = 0.1, sort = FALSE, ...)
## クラス factanal に対する print メソッド
print(x, digits = 3, ...)
**因子得点 [#sd166bd0]
* 正準相関、canonical correlation [#cbd3ebc0]
** 正準相関 cancor() [#s11a612d]
二つのデータ行列間の正準相関係数を計算する。
cancor(x, y, xcenter = TRUE, ycenter = TRUE)
* 多次元尺度法、MDS (multidimensional scaling) [#z1018969]
** 古典的(距離)多次元尺度法 cmdscale() [#zbb71fc7]
データ行列の多次元尺度法用の関数である。principal coordin...
cmdscale(d, k = 2, eig = FALSE, add = FALSE, x.ret = FAL...
** Kruskal の非計量的多次元尺度法 isoMDS [#u9f8eed3]
** 非計量的多次元尺度法 sammon [#b4e3090f]
* ユーティリティ関数 [#rdaba37f]
** 距離行列を計算する dist() [#g942fbc4]
この関数はデータ行列の各行間の距離を、指定された各種距離...
dist(x, method = "euclidean", diag = FALSE, upper = FALSE)
as.dist(m, diag = FALSE, upper = FALSE)
## クラス "dist" に対するメソッド
print(x, diag = NULL, upper = NULL, digits = getOption("...
justify = "none", right = TRUE, ...)
## クラス "dist" に対するメソッド
as.matrix(x)
** 多変量データのバイプロット biplot() [#mec14ff7]
現在のグラフィックスデバイスに多変量データのバイプロット...
biplot(x, y, var.axes = TRUE, col, cex = rep(par("cex"),...
xlabs = NULL, ylabs = NULL, expand = 1, ...
xlim = NULL, ylim = NULL, arrow.len = 0.1, ...
main = NULL, sub = NULL, xlab = NULL, ylab = NULL...
* 判別分析 (discriminant analysis) (MASS パッケージ中) [#...
今一つの多変量解析の代表的古典的手法である「判別分析」(di...
** 線形判別関数 lda() [#g001506e]
線形判別分析 (linear discriminant analysis) を行う。この...
lda(x, grouping, prior = proportions, tol = 1.0e-4,
method, CV = FALSE, nu, ...)
## クラス "formula" 用
lda(formula, data, ..., subset, na.action)
## クラス "data.frame" 用
lda(x, ...)
## クラス "matrix" 用
lda(x, grouping, ..., subset, na.action = na.fail)
** 線形判別分析による予測 predict() [#z2ce2f12]
多変量観測値を lda() に連動して判別する。そして、データを...
## クラス "lda" 用
predict(object, newdata, prior = object$prior, dimen,
method = c("plug-in", "predictive", "debiased"),...
** 二次判別関数 qda() [#lf3ea005]
qda() は二次関数(Maharanobis 距離による楕円状の判別領域を...
(quadratic discriminant analysis) を行う。
QR 分解を使い、もしグループ内共分散行列が特定のグループに...
## 既定手法
qda(x, grouping, prior = proportions,
method, CV = FALSE, nu, ...)
## クラス "formula" 用
qda(formula, data, ..., subset, na.action)
## クラス "data.frame" 用
qda(x, ...)
## クラス "matrix" 用
qda(x, grouping, ..., subset, na.action = na.fail)
** 二次判別関数による予測 [#qca2af88]
この関数はクラス "qda" に対する総称的関数 predict() の一...
## S3 method for class 'qda':
predict(object, newdata, prior = object$prior,
method = c("plug-in", "predictive", "debiased", ...
* 多変量解析アドオンパッケージ multiv 中のオブジェクト [#...
以下は library(help=multiv) で得られる multiv パッケージ...
なお、パッケージバンドル VR 中の推奨パッケージ MASS, clas...
ca() 対応分析 (correspondence analysis)。多変量デ...
最大の慣性(inertia)を持ち、二番目の座標は最...
最大の慣性を持ち、等々の基準で新しい座標系求...
各行と列は関連する質量(mass)を持ち(行と列の...
ユークリッド距離にとって代わる。入力データを...
重要であり、これが主成分分析の入力データ変換...
bea() 結合エネルギアルゴリズム(bond energy algorit...
近似度を最大化するように入れ換える
flou() (3元分類)ファジーコーディング。ベクトルの単...
ベクトル中の各値は 1 (67 番目のクォンタイル...
0 と 1 の間で線形補間 (33, 67 番目のクォンタ...
hierclust() 階層的クラスタリング。hclust() の代替関数
logique() 論理値コーディング。中央値以上、未満の値をそ...
members() データの各クラスターへの所属関係を表示
ページ名: