●データソースについて
下記の計算に使用したデータは:

Ball, G.E., and D.R. Maddison, 1987. Classification and evolutionary
aspects of the species of the New World genus Amblygnathus Dejean, with
description of Platymetopsis, new genus, and notes about selected
species of Selenophorus Dejean (Coleoptera: Carabidae: Harpalini).
Transactions of the American Entomological Society, 113: 189-307.

から得たものである.

元データ行列は「29OTU×28形態形質」のサイズであるが,欠測値(「?」)を含むOTUを除去した「22OTU×28形質」をテストデータとして用いた.→データ

形態形質のコード化は下記の通りである.

1 m.l._vent._flange / absent present,
2 elyt._micro. / isodiametric transverse,
3 body_length / '4.5-6.2mm' '6.3-7.0mm' '7.7-11.0mm' '>12.0mm',
4 pron._hind_ang. / rounded subangulate angulate,
5 #_int_sac_spines / none one two numerous,
6 spine_size / absent small medium large,
7 'spine loc''n' / absent scattered 'ventro-med' 'ventro-bas',
8 prostern._process / not ridged,
9 head_micros. / isodiam 'iso-transv' transv,
10 elytral_vest. / '7-9_+_ap1-6' '8-9_+_ap1-7' '9_+_ap1-8' '8-9' 9 'ap1-8' 0,
11 'head + pron color' / black rufous metal. 'bl_+_flavous',
12 clypeal_margin / ア_straight concave,
13 left_mand._apex / normal broad,
14 spermatheca / short_curve long_coil,
15 male_lamina_width / broad narrow,
16 lamina_length / long moderate short absent,
17 lam._apex_dir. / straight right dorsal,
18 apex_shape / pointed blunt,
19 m.l._apex_form / v._short mod_straight long sinuate,
20 m.l._flange_bilo / not bilobed,
21 dorsal_flange / absent v._small small large,
22 female_terg.8_setae / absent present,
23 sac_microtrich. / normal enlarged,
24 leg_color / flavous black,
25 'm.l. vent.-sculp.' / smooth serrate,
26 elytral_color / black metallic bicolored,
27 'm.l. vent.-form' / tapered spatulate,
28 pron._base / constrict. moderate broadened
下記のクラスター分析では,すべての形質は順序型(ordered)の形質と仮定する.

●データの読みこみと前処理
> beetle <- read.table("R-cluster.data", header=F)
# データ「R-cluster.data」をオブジェクト「beetle」に格納する.
# 第1行目は形質のコメント行ではないので「header=F」と指定する.

> beetle
# オブジェクト「beetle」を表示する.
# 行番号「1〜」ならびに列番号「V1〜」が自動的に付く.

V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18
1 seriatoporus-g 1 0 1 0 3 3 1 0 0 3 0 0 0 0 0 1 1
2 ellipticus-g 1 0 0 1 0 0 0 1 0 2 0 0 0 0 0 0 1
3 amaroides-g 1 1 0 1 0 0 0 1 1 5 0 0 0 0 0 0 1
4 ruficollis-g 0 1 0 2 3 1 1 0 0 6 1 0 0 0 0 0 1
5 iripennis 0 1 0 1 1 3 2 0 1 0 0 1 1 1 0 0 1
6 mexicanus 0 1 0 0 2 2 2 0 1 0 0 1 1 1 0 0 1
7 interior 0 1 0 0 2 2 2 0 1 0 0 1 1 1 0 0 1
8 evansi 0 1 0 0 2 2 2 0 1 3 0 1 1 1 0 1 1
9 panamensis 0 1 0 1 2 2 2 0 1 0 0 1 1 1 0 0 0
10 woodruffi 0 1 0 1 2 2 2 0 2 0 0 1 1 1 0 1 1
11 puncticollis 0 1 0 0 2 2 2 0 2 0 0 1 1 1 0 1 1
12 tikal 0 1 0 2 2 1 2 0 1 2 0 1 1 1 0 2 0
13 subtinctus 0 1 0 2 2 2 2 0 1 0 0 1 1 1 0 2 0
14 braziliensis 1 1 0 1 1 1 3 0 1 6 0 1 1 1 1 2 0
15 suturalis 1 1 1 1 1 1 2 0 2 1 3 1 1 1 1 2 0
16 geminatus 0 1 0 1 1 1 2 0 1 0 0 1 1 1 1 2 0
17 corvinus 0 1 2 1 1 1 2 0 1 4 0 1 0 1 1 0 0
18 cephalotes 1 1 2 1 0 0 0 0 1 0 0 1 0 1 1 0 0
19 gigas 1 1 3 1 0 0 0 0 1 0 0 1 0 1 1 0 0
20 reichardti 1 1 2 1 0 0 0 0 2 4 2 1 0 1 1 0 0
21 lucidus 1 1 2 1 0 0 0 0 2 4 2 1 0 1 1 0 0
22 janthinus 1 1 2 1 0 0 0 0 2 6 2 1 0 1 1 0 0

V19 V20 V21 V22 V23 V24 V25 V26 V27 V28 V29
1 0 1 0 2 0 0 0 0 0 0 1
2 0 1 0 2 0 0 0 0 0 0 1
3 0 1 0 2 0 0 0 0 0 0 1
4 0 1 0 2 0 0 0 0 0 0 1
5 0 1 0 2 0 0 0 0 0 0 1
6 0 2 0 3 0 0 0 0 0 0 1
7 0 2 0 1 1 0 0 0 0 0 1
8 0 1 0 1 1 0 0 0 0 0 1
9 0 1 0 1 1 0 0 0 0 0 1
10 0 1 0 1 1 0 0 0 0 0 1
11 0 1 0 1 1 0 0 0 0 0 1
12 1 1 0 2 1 0 0 0 0 0 1
13 1 1 0 1 1 0 0 0 0 0 1
14 1 1 0 2 0 1 0 1 0 0 1
15 1 1 0 2 0 1 0 1 2 0 1
16 1 1 0 2 1 1 0 0 0 0 1
17 1 2 0 2 0 0 1 1 0 0 2
18 1 3 0 2 1 0 1 0 0 0 1
19 1 3 0 2 1 0 1 0 0 0 1
20 1 2 0 2 1 0 1 0 1 0 1
21 1 2 0 2 1 0 1 0 1 0 1
22 1 2 0 2 1 0 0 0 1 0 0

> beetle.x <- beetle[, -1]
# 種名列である第1列を除去したデータ行列をオブジェクト「beetle.x」に格納する.

> beetle.x
# オブジェクト「beetle.x」を表示する.

V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21 V22
1 1 0 1 0 3 3 1 0 0 3 0 0 0 0 0 1 1 0 1 0 2
2 1 0 0 1 0 0 0 1 0 2 0 0 0 0 0 0 1 0 1 0 2
3 1 1 0 1 0 0 0 1 1 5 0 0 0 0 0 0 1 0 1 0 2
4 0 1 0 2 3 1 1 0 0 6 1 0 0 0 0 0 1 0 1 0 2
5 0 1 0 1 1 3 2 0 1 0 0 1 1 1 0 0 1 0 1 0 2
6 0 1 0 0 2 2 2 0 1 0 0 1 1 1 0 0 1 0 2 0 3
7 0 1 0 0 2 2 2 0 1 0 0 1 1 1 0 0 1 0 2 0 1
8 0 1 0 0 2 2 2 0 1 3 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算
> d.manhattan <- dist(beetle.x, method="manhattan")
# 「beetle.x」のOTU間のマンハッタン距離を計算し,オブジェクト「d.manhattan」に格納する.

> d.manhattan
# 内容表示.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
2 12
3 15 5
4 12 14 11
5 15 15 16 17
6 16 18 19 18 5
7 17 19 20 19 6 3
8 12 18 17 16 9 8 5
9 18 18 19 18 5 6 3 6
10 17 19 20 19 6 7 4 5 3
11 16 20 21 20 7 6 3 4 4 1
12 18 18 19 16 11 12 11 8 8 9 10
13 20 22 23 20 9 10 7 8 4 5 6 4
14 22 22 17 18 17 20 21 16 18 19 20 12 16
15 25 25 26 27 18 21 22 21 19 18 19 15 17 13
16 22 20 21 22 9 12 11 12 8 9 10 6 6 10 11
17 21 21 18 19 16 17 18 17 17 20 21 15 19 13 18 15
18 24 16 17 26 17 18 17 22 16 19 20 18 18 22 21 14 13
19 25 17 18 27 18 19 18 23 17 20 21 19 19 23 22 15 14 1
20 25 19 16 23 24 25 24 23 23 24 25 21 25 21 18 21 12 9 10
21 25 19 16 23 24 25 24 23 23 24 25 21 25 21 18 21 12 9 10 0
22 27 21 16 21 26 27 26 25 25 26 27 23 27 19 20 23 16 13 14 4 4

> d.euclid <- dist(beetle.x, method="euclid")
# 同様にして「beetle.x」のユークリッド距離を計算し,オブジェクト「d.euclid」に格納する.

> d.euclid
# 内容表示
1 2 3 4 5 6 7 8
2 4.898979
3 5.385165 3.316625
4 4.690416 5.656854 4.123106
5 4.795832 5.000000 6.633250 7.141428
6 4.690416 5.099020 6.708204 7.071068 2.236068
7 4.795832 5.196152 6.782330 7.141428 2.449490 2.236068
8 3.464102 4.898979 5.000000 4.898979 3.872983 4.000000 3.316625
9 4.898979 5.099020 6.708204 6.928203 2.236068 2.828427 1.732051 3.464102
10 5.000000 5.385165 6.782330 7.141428 2.449490 3.000000 2.000000 3.316625
11 4.898979 5.477226 6.855655 7.348469 2.645751 2.828427 1.732051 3.162278
12 4.690416 4.898979 5.567764 5.477226 4.123106 4.242641 4.123106 3.162278
13 5.291503 5.656854 7.141428 7.211103 3.316625 4.000000 3.316625 4.000000
14 5.830952 6.480741 5.000000 4.898979 7.141428 7.211103 7.280110 4.690416
15 6.403124 6.244998 7.071068 7.549834 5.477226 5.567764 5.656854 5.567764
16 5.656854 5.099020 6.708204 7.483315 3.605551 3.741657 3.605551 4.242641
17 5.000000 5.196152 4.690416 5.000000 5.656854 5.567764 5.656854 4.358899
18 6.633250 4.690416 6.403124 8.124038 5.385165 5.099020 5.000000 6.164414
19 6.855655 5.196152 6.782330 8.426150 5.830952 5.567764 5.477226 6.557439
20 6.403124 5.196152 4.472136 5.916080 6.928203 6.855655 6.782330 5.744563
21 6.403124 5.196152 4.472136 5.916080 6.928203 6.855655 6.782330 5.744563
22 7.000000 6.244998 4.472136 5.567764 8.246211 8.185353 8.124038 6.403124
9 10 11 12 13 14 15 16
2
3
4
5
6
7
8
9
10 1.732051
11 2.000000 1.000000
12 3.464102 3.316625 3.741657
13 2.449490 2.236068 2.828427 2.449490
14 7.071068 7.000000 7.071068 4.898979 6.782330
15 5.385165 5.099020 5.196152 4.795832 5.000000 6.403124
16 3.162278 3.000000 3.162278 2.828427 2.449490 6.324555 4.358899
17 5.567764 5.830952 5.916080 4.582576 5.916080 4.358899 5.830952 5.567764
18 5.099020 5.385165 5.477226 5.477226 5.477226 8.000000 5.916080 4.690416
19 5.567764 5.830952 5.916080 5.916080 5.916080 8.306624 6.164414 5.196152
20 6.708204 6.782330 6.855655 5.744563 7.000000 5.916080 5.291503 6.403124
21 6.708204 6.782330 6.855655 5.744563 7.000000 5.916080 5.291503 6.403124
22 8.062258 8.124038 8.185353 6.708204 8.306624 5.567764 6.633250 7.810250
17 18 19 20 21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 5.196152
19 5.291503 1.000000
20 4.000000 4.795832 4.898979
21 4.000000 4.795832 4.898979 0.000000
22 4.898979 6.708204 6.782330 2.449490 2.449490

●クラスタリング
上で求めたマンハッタン距離行列「d.manhattan」とユークリッド距離行列「d.euclid」に基づいて,〈hclust〉によりクラスタリングを行なう.クラスタリングのオプション設定は下記の通り:

method="single"  single linkage method
method="complete"  complete linkage method
method="average"  UPGMA
method="mcquitty"  McQuitty method
method="centroid"  UPGMC
method="median"  WPGMC
method="ward"  Ward method

各オプション設定での出力を距離行列のタイプごとにまとめる.まずはじめに,マンハッタン距離を用いたときのクラスタリング:

> h1.single <- hclust(d.manhattan, method="single")
> plclust(h1.single, hang=-1)



> h1.complete <- hclust(d.manhattan, method="complete")
> plclust(h1.complete, hang=-1)



> h1.average <- hclust(d.manhattan, method="average")
> plclust(h1.average, hang=-1)



> h1.mcquitty <- hclust(d.manhattan, method="mcquitty")
> plclust(h1.mcquitty, hang=-1)



> h1.centroid <- hclust(d.manhattan, method="centroid")
> plclust(h1.centroid, hang=-1)



> h1.median <- hclust(d.manhattan, method="median")
> plclust(h1.median, hang=-1)



> h1.ward <- hclust(d.manhattan, method="ward")
> plclust(h1.ward, hang=-1)



続いて,ユークリッド距離を用いたときのクラスタリング:

> h2.single <- hclust(d.euclid, method="single")
> plclust(h2.single, hang=-1)



> h2.complete <- hclust(d.euclid, method="complete")
> plclust(h2.complete, hang=-1)



> h2.average <- hclust(d.euclid, method="average")
> plclust(h2.average, hang=-1)



> h2.mcquitty <- hclust(d.euclid, method="mcquitty")
> plclust(h2.mcquitty, hang=-1)



> h2.centroid <- hclust(d.euclid, method="centroid")
> plclust(h2.median, hang=-1)



> h2.median <- hclust(d.euclid, method="median")
> plclust(h2.centroid, hang=-1)



> h2.ward <- hclust(d.euclid, method="ward")
> plclust(h2.ward, hang=-1)