{"id":4810,"date":"2026-09-22T20:26:54","date_gmt":"2026-09-22T11:26:54","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/?p=4810"},"modified":"2026-09-22T20:26:54","modified_gmt":"2026-09-22T11:26:54","slug":"what-is-nb-clust-1-actually-doing-opening-the-black-box-of-hcpc-hierarchical-clustering-and-its-k-means-consolidation-mechanism","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/what-is-nb-clust-1-actually-doing-opening-the-black-box-of-hcpc-hierarchical-clustering-and-its-k-means-consolidation-mechanism\/","title":{"rendered":"nb.clust = -1\u306f\u4f55\u3092\u3057\u3066\u3044\u308b\uff1fHCPC\uff08\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\uff09\u306e\u30d6\u30e9\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3068k-means\u518d\u8abf\u6574\u306e\u4ed5\u7d44\u307f"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/best-biostatistics.com\/toukei-er\/entry\/what-to-do-when-patient-data-mixes-continuous-and-categorical-variables-dimensionality-reduction-via-famd-and-clinical-phenotype-clustering-via-hcpc\/\">\u524d\u56de\u306e\u8a18\u4e8b<\/a>\u3067\u306f\u3001\u91cf\u7684\u5909\u6570\u3068\u8cea\u7684\u5909\u6570\u304c\u6df7\u5728\u3059\u308b\u60a3\u8005\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066FAMD\u3067\u6b21\u5143\u3092\u7e2e\u7d04\u3057\u3001\u305d\u306e\u4e3b\u6210\u5206\u306b\u5bfe\u3057\u3066HCPC\uff08Hierarchical Clustering on Principal Components\uff09\u3067\u81e8\u5e8a\u8868\u73fe\u578b\u3092\u540c\u5b9a\u3059\u308b\u3068\u3053\u308d\u307e\u3067\u3092\u89e3\u8aac\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u5148\u751f\uff01<code>HCPC(res_famd, nb.clust = -1)<\/code>\u3092\u5b9f\u884c\u3057\u305f\u3089\u3001\u52dd\u624b\u306b\u30af\u30e9\u30b9\u30bf\u6570\u304c3\u306b\u6c7a\u307e\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u306a\u305c3\u306a\u306e\u304b\u8aac\u660e\u3092\u6c42\u3081\u3089\u308c\u3066\u56f0\u3063\u3066\u3044\u307e\u3059\u2026\u2026\u300d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u5225\u306e\u7814\u7a76\u3067\u306f\u3001\u75c7\u4f8b\u6570\u304c\u6570\u5341\u4e07\u4ef6\u3042\u308b\u30c7\u30fc\u30bf\u3067HCPC\u3092\u5b9f\u884c\u3057\u305f\u3068\u3053\u308d\u3001\u3044\u3064\u307e\u3067\u7d4c\u3063\u3066\u3082\u51e6\u7406\u304c\u7d42\u308f\u3089\u305a\u3001\u6700\u7d42\u7684\u306b\u30e1\u30e2\u30ea\u30a8\u30e9\u30fc\u3067\u843d\u3061\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u306e\u3067\u3057\u3087\u3046\u304b\uff1f\u300d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u524d\u56de\u3001<code>nb.clust = -1<\/code>\u3068\u3044\u3046\u4e00\u884c\u3067\u81ea\u52d5\u7684\u306b\u30af\u30e9\u30b9\u30bf\u6570\u304c\u6c7a\u307e\u308b\u69d8\u5b50\u3092\u7d39\u4ecb\u3057\u305f\u304c\u3001\u305d\u306e\u4e2d\u8eab\u304c\u30d6\u30e9\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306e\u307e\u307e\u3067\u306f\u3001\u67fb\u8aad\u8005\u304b\u3089\u306e\u300c\u306a\u305c\u305d\u306e\u6570\u306a\u306e\u304b\u300d\u3068\u3044\u3046\u554f\u3044\u306b\u7b54\u3048\u3089\u308c\u306a\u3044\u3002\u307e\u305f\u3001\u5927\u898f\u6a21\u306a\u81e8\u5e8a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u6271\u3046\u7814\u7a76\u3067\u306f\u3001HCPC\u3092\u611a\u76f4\u306b\u5b9f\u884c\u3059\u308b\u3068\u30e1\u30e2\u30ea\u3092\u4f7f\u3044\u679c\u305f\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u8a18\u4e8b\u3067\u306f\u3001HCPC\u3068\u3044\u3046\u30d6\u30e9\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3092\u958b\u3051\u3001\u305d\u306e4\u6bb5\u968e\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u4e00\u3064\u305a\u3064\u78ba\u8a8d\u3057\u305f\u3046\u3048\u3067\u3001\u5927\u898f\u6a21\u30c7\u30fc\u30bf\u3067\u30cf\u30de\u308a\u3084\u3059\u3044\u7f60\u3068\u305d\u306e\u56de\u907f\u7b56\u307e\u3067\u3092\u5fb9\u5e95\u89e3\u8aac\u3059\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. HCPC\u3068\u306f\u4f55\u304b\uff1f <code>hclust()<\/code> \u3068\u306e\u9055\u3044<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">R\u3067\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3068\u8a00\u3048\u3070<code>hclust()<\/code>\u95a2\u6570\u3092\u601d\u3044\u6d6e\u304b\u3079\u308b\u4eba\u304c\u591a\u3044\u3060\u308d\u3046\u3002<code>hclust()<\/code>\u306f\u3001\u4e0e\u3048\u3089\u308c\u305f\u5909\u6570\u3092\u3059\u3079\u3066\u305d\u306e\u307e\u307e\u62b1\u3048\u3066\u8ddd\u96e2\u884c\u5217\u3092\u4f5c\u308a\u3001\u4f75\u5408\u3092\u7e70\u308a\u8fd4\u3057\u3066\u3044\u304f\u65b9\u6cd5\u3067\u3042\u308b\u3002\u305f\u3068\u3048\u308b\u306a\u3089\u3001\u8377\u7269\u306e\u4e2d\u8eab\u3092\u6574\u7406\u3057\u306a\u3044\u307e\u307e\u3001\u5fc5\u8981\u306a\u88c5\u5099\u3082\u4e0d\u8981\u306a\u5c0f\u7269\u3082\u6e3e\u7136\u4e00\u4f53\u3068\u3057\u3066\u304e\u3085\u3046\u304e\u3085\u3046\u306b\u8a70\u3081\u8fbc\u3093\u3060\u3001\u30d1\u30f3\u30d1\u30f3\u306e\u30d0\u30c3\u30af\u30d1\u30c3\u30af\u3092\u80cc\u8ca0\u3063\u3066\u767b\u5c71\u9053\u3092\u767b\u308b\u3088\u3046\u306a\u3082\u306e\u3067\u3042\u308b\u3002\u80cc\u8ca0\u3063\u3066\u3044\u308b\u672c\u4eba\u306b\u3059\u3089\u3001\u30d0\u30c3\u30af\u30d1\u30c3\u30af\u306e\u4e2d\u3067\u4f55\u304c\u3069\u308c\u3060\u3051\u304b\u3055\u3070\u3063\u3066\u3044\u308b\u306e\u304b\u628a\u63e1\u3067\u304d\u3066\u3044\u306a\u3044\u72b6\u614b\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u306b\u5bfe\u3057\u3066HCPC\u306f\u3001\u305d\u306e\u540d\u306e\u901a\u308a\u300c\u4e3b\u6210\u5206\uff08Principal Components\uff09\u306b\u5bfe\u3057\u3066\u884c\u3046\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u300d\u3067\u3042\u308b\u3002FAMD\u3084PCA\u3001MCA\u3001MFA\u3068\u3044\u3063\u305f\u4e3b\u6210\u5206\u6cd5\u3067\u3044\u3063\u305f\u3093\u30c7\u30fc\u30bf\u3092\u7e2e\u7d04\u3057\u3001\u672c\u5f53\u306b\u5fc5\u8981\u306a\u88c5\u5099\u3060\u3051\u3092\u30b3\u30f3\u30d1\u30af\u30c8\u306b\u6574\u7406\u3057\u76f4\u3057\u3066\u304b\u3089\u767b\u5c71\u3092\u59cb\u3081\u308b\u3001\u3068\u3044\u3046\u30a4\u30e1\u30fc\u30b8\u3092\u6301\u3064\u3068\u308f\u304b\u308a\u3084\u3059\u3044\u3002\u30d1\u30f3\u30d1\u30f3\u3060\u3063\u305f\u30d0\u30c3\u30af\u30d1\u30c3\u30af\u306e\u4e2d\u8eab\u3092\u3001\u304b\u3055\u3070\u308b\u7121\u99c4\u306a\u8377\u7269\u3092\u6e1b\u3089\u3057\u3066\u6a5f\u80fd\u3054\u3068\u306b\u5c0f\u3055\u304f\u307e\u3068\u3081\u76f4\u3059\u3053\u3068\u3067\u3001\u540c\u3058\u767b\u5c71\u9053\u3067\u3082\u8db3\u53d6\u308a\u304c\u8efd\u304f\u3001\u8ff7\u3044\u306b\u304f\u304f\u306a\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5168\u5909\u6570\u3092\u751f\u306e\u307e\u307e<code>hclust()<\/code>\u306b\u6295\u5165\u3059\u308b\u3068\u3001\u5909\u6570\u9593\u306e\u76f8\u95a2\u3084\u4e0d\u8981\u306a\u30ce\u30a4\u30ba\u306e\u5f71\u97ff\u3092\u305d\u306e\u307e\u307e\u5f15\u304d\u305a\u3063\u3066\u3057\u307e\u3046\u3002HCPC\u306f\u305d\u306e\u624b\u524d\u306b\u300c\u8377\u7269\u3092\u8efd\u304f\u3059\u308b\u300d\u30b9\u30c6\u30c3\u30d7\u3092\u631f\u3080\u3053\u3068\u3067\u3001\u3088\u308a\u5b89\u5b9a\u3057\u305f\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u73fe\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u203b\u30b3\u30e9\u30e0\uff1aWard\u6cd5\u3068\u306f<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">HCPC\u306e\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3067\u306f\u3001\u65e2\u5b9a\u3067\u300cWard\u6cd5\u300d\u3068\u3044\u3046\u9023\u7d50\u6cd5\u304c\u4f7f\u308f\u308c\u308b\u3002Ward\u6cd5\u306f\u3001\u30af\u30e9\u30b9\u30bf\u3092\u4f75\u5408\u3059\u308b\u305f\u3073\u306b\u300c\u30af\u30e9\u30b9\u30bf\u5185\u306e\u3070\u3089\u3064\u304d\uff08\u5206\u6563\uff09\u304c\u3069\u308c\u3060\u3051\u5897\u3048\u308b\u304b\u300d\u3092\u57fa\u6e96\u306b\u3001\u305d\u306e\u5897\u52a0\u304c\u6700\u3082\u5c0f\u3055\u304f\u306a\u308b\u30da\u30a2\u3092\u4f75\u5408\u3057\u3066\u3044\u304f\u65b9\u6cd5\u3067\u3042\u308b\u3002\u4e3b\u6210\u5206\u5206\u6790\u304c\u300c\u30c7\u30fc\u30bf\u306e\u5206\u6563\u3092\u8ef8\u3068\u3057\u3066\u6349\u3048\u308b\u300d\u624b\u6cd5\u3067\u3042\u308b\u3053\u3068\u3068\u76f8\u6027\u304c\u3088\u3044\u305f\u3081\u3001HCPC\u3067\u306fWard\u6cd5\u304c\u6a19\u6e96\u63a1\u7528\u3055\u308c\u3066\u3044\u308b\u3002\u306a\u304a\u3001<code>HCPC()<\/code>\u306f\u5185\u90e8\u7684\u306b<code>cluster<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e<code>agnes()<\/code>\u95a2\u6570\u3092\u7528\u3044\u3066Ward\u6cd5\u3092\u5b9f\u88c5\u3057\u3066\u304a\u308a\u3001\u6a19\u6e96\u306e<code>hclust(method = \"ward.D2\")<\/code>\u3068\u306f\u5b9f\u88c5\u4e0a\u306e\u7d30\u90e8\uff08\u8ddd\u96e2\u306e\u66f4\u65b0\u5f0f\u306a\u3069\uff09\u304c\u7570\u306a\u308b\u5834\u5408\u304c\u3042\u308b\u70b9\u306b\u306f\u7559\u610f\u3055\u308c\u305f\u3044\u3002<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">2. HCPC\u306e\u4e2d\u8eab\u3092\u958b\u3051\u308b\uff1a4\u30b9\u30c6\u30c3\u30d7\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">HCPC\u306f\u3001\u5185\u90e8\u7684\u306b\u6b21\u306e4\u3064\u306e\u30b9\u30c6\u30c3\u30d7\u3092\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3057\u3066\u3044\u308b\u3002\u3053\u306e4\u30b9\u30c6\u30c3\u30d7\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u3001<code>nb.clust = -1<\/code>\u3068\u3044\u3046\u30d6\u30e9\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3092\u958b\u3051\u308b\u9375\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step\u2460\u3000\u4e3b\u6210\u5206\u6cd5\u306e\u5b9f\u884c<\/strong>\uff1a\u30c7\u30fc\u30bf\u306e\u578b\u306b\u5fdc\u3058\u3066PCA\u30fbMCA\u30fbFAMD\u30fbMFA\u306e\u3044\u305a\u308c\u304b\u3092\u5b9f\u884c\u3057\u3001<code>ncp<\/code>\u500b\uff08\u65e2\u5b9a5\uff09\u306e\u6b21\u5143\u3092\u6b8b\u3059\u3002\u3053\u308c\u304c\u300c\u30ce\u30a4\u30ba\u9664\u53bb\u30fb\u8377\u7269\u3092\u8efd\u304f\u3059\u308b\u300d\u30b9\u30c6\u30c3\u30d7\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step\u2461\u3000\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0<\/strong>\uff1a\u6b8b\u3057\u305f\u4e3b\u6210\u5206\u306b\u5bfe\u3057\u3001Ward\u6cd5\uff08\u65e2\u5b9a\uff09\u3067\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u884c\u3044\u3001\u6a39\u5f62\u56f3\uff08\u30c7\u30f3\u30c9\u30ed\u30b0\u30e9\u30e0\uff09\u3092\u4f5c\u308b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step\u2462\u3000\u30af\u30e9\u30b9\u30bf\u6570\u306e\u6c7a\u5b9a<\/strong>\uff1a\u30c7\u30f3\u30c9\u30ed\u30b0\u30e9\u30e0\u306e\u3069\u306e\u9ad8\u3055\u3067\u5207\u308b\u304b\uff08\uff1d\u3044\u304f\u3064\u306e\u30af\u30e9\u30b9\u30bf\u306b\u5206\u3051\u308b\u304b\uff09\u3092\u6c7a\u3081\u308b\u30b9\u30c6\u30c3\u30d7\u3067\u3042\u308b\u3002\u5404\u5206\u5272\u306b\u3064\u3044\u3066\u300c\u30af\u30e9\u30b9\u30bf\u5185\u6163\u6027\uff08within-cluster inertia\uff09\u300d\u306e\u5408\u8a08\u3092\u8a08\u7b97\u3057\u3001\u5206\u5272\u30921\u3064\u5897\u3084\u3057\u305f\u3068\u304d\u306b\u6163\u6027\u304c\u3069\u308c\u3060\u3051\u76f8\u5bfe\u7684\u306b\u6e1b\u5c11\u3059\u308b\u304b\u3092\u898b\u308b\u3002\u3053\u306e\u76f8\u5bfe\u7684\u306a\u6e1b\u5c11\u5e45\u304c\u6700\u3082\u5927\u304d\u304f\u306a\u308b\u5206\u5272\u304c\u3001\u63a8\u5968\u3055\u308c\u308b\u30af\u30e9\u30b9\u30bf\u6570\u3068\u3057\u3066\u63d0\u6848\u3055\u308c\u308b\u3002<code>nb.clust = -1<\/code>\u3068\u6307\u5b9a\u3057\u305f\u3068\u304d\u306b\u81ea\u52d5\u7684\u306b\u6c7a\u307e\u308b\u6570\u306e\u6b63\u4f53\u306f\u3001\u3053\u308c\u3067\u3042\u308b\u3002\uff08\u306a\u304a\u3001\u3053\u3053\u3067\u306f\u8003\u3048\u65b9\u3092\u5e73\u6613\u306b\u8aac\u660e\u3057\u3066\u304a\u308a\u3001\u53b3\u5bc6\u306a\u8a08\u7b97\u5f0f\u306b\u3064\u3044\u3066\u306fFactoMineR\u306e\u516c\u5f0f\u5b9f\u88c5\u30fb\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u53c2\u7167\u3055\u308c\u305f\u3044\u3002\uff09<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step\u2463\u3000k-means\u306b\u3088\u308b\u518d\u8abf\u6574\uff08consolidation\uff09<\/strong>\uff1aStep\u2462\u3067\u5f97\u3089\u308c\u305f\u521d\u671f\u306e\u5206\u5272\u3092\u51fa\u767a\u70b9\u3068\u3057\u3066\u3001k-means\u3067\u5404\u500b\u4f53\u306e\u6240\u5c5e\u3092\u5fae\u8abf\u6574\u3059\u308b\u3002\u65e2\u5b9a\u3067\u306f<code>consol = TRUE<\/code>\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u6700\u7d42\u7684\u306a\u7d50\u679c\u306f\u300c\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u5358\u4f53\u306e\u7d50\u679c\u300d\u3068\uff08\u308f\u305a\u304b\u306b\uff09\u7570\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u3053\u308c\u306f\u3001\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u304c\u4e00\u5ea6\u4f75\u5408\u3057\u305f\u3089\u5f8c\u623b\u308a\u3067\u304d\u306a\u3044\u6027\u8cea\u3092\u6301\u3064\u306e\u306b\u5bfe\u3057\u3001k-means\u306b\u3088\u308b\u518d\u8abf\u6574\u3067\u500b\u4f53\u3092\u8fd1\u3044\u65b9\u306e\u30af\u30e9\u30b9\u30bf\u4e2d\u5fc3\u306b\u4ed8\u3051\u66ff\u3048\u76f4\u3057\u3066\u3044\u308b\u305f\u3081\u3067\u3042\u308b\u3002\u306a\u304a\u3001\u3053\u306e\u518d\u8abf\u6574\u306b\u306f<code>iter.max<\/code>\uff08\u65e2\u5b9a10\u56de\uff09\u3068\u3044\u3046\u53cd\u5fa9\u56de\u6570\u306e\u4e0a\u9650\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001k-means\u304c\u5fc5\u305a\u53ce\u675f\u3059\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3057\u305f\u624b\u7d9a\u304d\u3067\u306f\u306a\u3044\u70b9\u306b\u3082\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u203b\u30b3\u30e9\u30e0\uff1a\u300c\u6163\u6027\uff08inertia\uff09\u300d\u3068\u306f<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6163\u6027\u306f\u3001\u7d71\u8a08\u5b66\u306b\u304a\u3051\u308b\u300c\u5206\u6563\u300d\u3092\u591a\u6b21\u5143\u306b\u62e1\u5f35\u3057\u305f\u6982\u5ff5\u3060\u3068\u8003\u3048\u308b\u3068\u3088\u3044\u30021\u3064\u306e\u5909\u6570\u306e\u6563\u3089\u3070\u308a\u5177\u5408\u3092\u8868\u3059\u306e\u304c\u5206\u6563\u3060\u3068\u3059\u308c\u3070\u3001\u6163\u6027\u306f\u8907\u6570\u306e\u4e3b\u6210\u5206\u8ef8\u306b\u307e\u305f\u304c\u3063\u305f\u30c7\u30fc\u30bf\u5168\u4f53\u306e\u6563\u3089\u3070\u308a\u5177\u5408\u3092\u8868\u3059\u6307\u6a19\u3067\u3042\u308b\u3002Step\u2462\u3067\u3044\u3046\u300c\u30af\u30e9\u30b9\u30bf\u5185\u6163\u6027\u300d\u3068\u306f\u3001\u5404\u30af\u30e9\u30b9\u30bf\u306e\u4e2d\u3067\u500b\u4f53\u304c\u3069\u308c\u3060\u3051\u5bc6\u96c6\u3057\u3066\u3044\u308b\u304b\u3092\u793a\u3057\u3066\u304a\u308a\u3001\u3053\u306e\u5024\u304c\u5c0f\u3055\u3044\u307b\u3069\u3001\u307e\u3068\u307e\u308a\u306e\u3088\u3044\u30af\u30e9\u30b9\u30bf\u3060\u3068\u8a00\u3048\u308b\u3002<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e4\u30b9\u30c6\u30c3\u30d7\u3092\u8e0f\u307e\u3048\u308b\u3068\u3001Step\u2462\u304c\u300c\u306a\u305c\u305d\u306e\u6570\u306e\u30af\u30e9\u30b9\u30bf\u306b\u306a\u3063\u305f\u306e\u304b\u300d\u3068\u3044\u3046\u7591\u554f\u3078\u306e\u56de\u7b54\u3067\u3042\u308a\u3001Step\u2463\u304c\u300c\u306a\u305c\u7d50\u679c\u304c\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u5358\u4f53\u3068\u5c11\u3057\u30ba\u30ec\u308b\u306e\u304b\u300d\u3068\u3044\u3046\u7591\u554f\u3078\u306e\u56de\u7b54\u3067\u3042\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<div id=\"biost-1206699771\" class=\"biost- biost-entity-placement\"><p style=\"text-align: center;\"><span style=\"font-size: 20px;\"><strong><a href=\"https:\/\/best-biostatistics.com\/kmhl\">\uff1e\uff1e\u3082\u3046\u7d71\u8a08\u3067\u60a9\u3080\u306e\u306f\u7d42\u308f\u308a\u306b\u3057\u307e\u305b\u3093\u304b\uff1f\u00a0<\/a><\/strong><\/span><\/p>\r\n<a href=\"https:\/\/best-biostatistics.com\/kmhl\"><img class=\"aligncenter wp-image-2794 size-full\" src=\"https:\/\/best-biostatistics.com\/wp\/wp-content\/uploads\/2023\/11\/bn_r_03.png\" alt=\"\" width=\"500\" height=\"327\" \/><\/a>\r\n<p style=\"text-align: center;\"><span style=\"color: #ff0000; font-size: 20px;\"><strong><span class=\"marker2\">\u21911\u4e07\u4eba\u4ee5\u4e0a\u306e\u533b\u7642\u5f93\u4e8b\u8005\u304c\u8cfc\u8aad\u4e2d<\/span><\/strong><\/span><\/p><\/div><h2 class=\"wp-block-heading\">3. \u5927\u898f\u6a21\u30c7\u30fc\u30bf\u3067\u30cf\u30de\u308b\u7f60\u3068<code>kk<\/code>\u5f15\u6570\u306b\u3088\u308b\u89e3\u6c7a<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u81e8\u5e8a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u75c7\u4f8b\u6570\u304c\u6570\u5341\u4e07\u4ef6\u898f\u6a21\u306b\u306a\u308b\u3068\u3001HCPC\u3092\u65e2\u5b9a\u8a2d\u5b9a\u306e\u307e\u307e\u5b9f\u884c\u3059\u308b\u3068\u6df1\u523b\u306a\u554f\u984c\u304c\u751f\u3058\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306f\u3001\u539f\u7406\u4e0a\u3059\u3079\u3066\u306e\u500b\u4f53\u9593\u306e\u8ddd\u96e2\u884c\u5217\u3092\u8a08\u7b97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u500b\u4f53\u6570\u304c$N$\u306e\u3068\u304d\u3001\u8ddd\u96e2\u884c\u5217\u306e\u8981\u7d20\u6570\u306f\u304a\u3088\u305d$N(N-1)\/2$\u500b\u306b\u3082\u306a\u308b\u3002\u75c7\u4f8b\u6570\u304c\u6570\u5341\u4e07\u4ef6\u898f\u6a21\u306b\u306a\u308b\u3068\u3001\u3053\u306e\u884c\u5217\u3060\u3051\u3067\u5fc5\u8981\u306a\u30e1\u30e2\u30ea\u91cf\u304c\u6570\u767eGB\u301c\u6570TB\u898f\u6a21\u306b\u81a8\u308c\u4e0a\u304c\u308a\u3001\u30e1\u30e2\u30ea\u4e0d\u8db3\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3002\u5b9f\u969b\u3001Stack Overflow\u7b49\u306eQ&amp;A\u30b5\u30a4\u30c8\u306b\u306f\u3001\u6570\u5341\u4e07\u884c\u898f\u6a21\u306e\u30c7\u30fc\u30bf\u3067HCPC\u3092\u5b9f\u884c\u3057\u30e1\u30e2\u30ea\u30a8\u30e9\u30fc\u306b\u76f4\u9762\u3057\u305f\u3068\u3044\u3046\u5229\u7528\u8005\u306e\u4f53\u9a13\u8ac7\u304c\u6295\u7a3f\u3055\u308c\u3066\u3044\u308b\uff08\u3053\u308c\u306f\u67fb\u8aad\u4ed8\u304d\u6587\u732e\u3067\u306f\u306a\u304f\u3001\u3042\u304f\u307e\u3067\u5229\u7528\u8005\u306b\u3088\u308b\u5b9f\u4f53\u9a13\u306e\u5831\u544a\u3067\u3042\u308b\u70b9\u306b\u306f\u7559\u610f\u3055\u308c\u305f\u3044\uff09\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6bd4\u55a9\u7684\u306b\u8a00\u3048\u3070\u3001\u3053\u308c\u306f\u300c\u5168\u6821\u751f\u5f92\u5168\u54e1\u540c\u58eb\u306e\u8ddd\u96e2\u3092\u624b\u4f5c\u696d\u3067\u6e2c\u308d\u3046\u3068\u3059\u308b\u300d\u3088\u3046\u306a\u3082\u306e\u3067\u3042\u308b\u3002\u751f\u5f92\u6570\u304c\u5897\u3048\u308b\u307b\u3069\u3001\u6e2c\u308b\u3079\u304d\u7d44\u307f\u5408\u308f\u305b\u306e\u6570\u306f\u751f\u5f92\u6570\u306e\u304a\u3088\u305d2\u4e57\u306e\u30da\u30fc\u30b9\u3067\u5897\u3048\u3066\u3044\u304f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u554f\u984c\u3078\u306e\u6a19\u6e96\u7684\u306a\u89e3\u6c7a\u7b56\u304c\u3001<code>kk<\/code>\u5f15\u6570\u3067\u3042\u308b\u3002<code>kk<\/code>\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001HCPC\u306f\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u884c\u3046\u524d\u306b\u3001\u307e\u305ak-means\u3067<code>kk<\/code>\u500b\u306e\u4ee3\u8868\u70b9\uff08\u91cd\u307f\u4ed8\u304d\u306e\u70b9\uff09\u3092\u4f5c\u308b\u3002\u305d\u306e\u3046\u3048\u3067\u3001\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306f\u3053\u306e<code>kk<\/code>\u500b\u306e\u4ee3\u8868\u70b9\u306b\u5bfe\u3057\u3066\u306e\u307f\u884c\u308f\u308c\u308b\u305f\u3081\u3001\u8ddd\u96e2\u884c\u5217\u306e\u30b5\u30a4\u30ba\u304c\u5287\u7684\u306b\u5c0f\u3055\u304f\u306a\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u75c7\u4f8b\u6570\u304c\u975e\u5e38\u306b\u591a\u3044\u3053\u3068\u3092\u60f3\u5b9a\u3057\u3001kk\u5f15\u6570\u3067\u4e8b\u524d\u306bk-means\u96c6\u7d04\u3092\u884c\u3046\u4f8b\nres_hcpc_big &lt;- HCPC(res_famd, kk = 100, nb.clust = -1, graph = FALSE)\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u306e\u3088\u3046\u306b<code>kk = 100<\/code>\u3068\u6307\u5b9a\u3059\u308c\u3070\u3001\u307e\u305ak-means\u3067100\u500b\u306e\u4ee3\u8868\u70b9\u306b\u96c6\u7d04\u3057\u305f\u3046\u3048\u3067\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u304c\u884c\u308f\u308c\u308b\u305f\u3081\u3001\u75c7\u4f8b\u6570\u304c\u6570\u5341\u4e07\u4ef6\u898f\u6a21\u3067\u3042\u3063\u3066\u3082\u73fe\u5b9f\u7684\u306a\u6642\u9593\u30fb\u30e1\u30e2\u30ea\u3067\u5b9f\u884c\u3067\u304d\u308b\u3002\u306a\u304a\u3001<code>kk<\/code>\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u306f<code>consol<\/code>\u306b\u3088\u308bk-means\u518d\u8abf\u6574\u306f\u884c\u308f\u308c\u306a\u3044\u70b9\u306b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. \u3010\u5b9f\u8df5R\u30b3\u30fc\u30c9\u3011FAMD\u306e\u7d9a\u304d\u3068\u3057\u3066\u306eHCPC\u5b9f\u88c5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/best-biostatistics.com\/toukei-er\/entry\/what-to-do-when-patient-data-mixes-continuous-and-categorical-variables-dimensionality-reduction-via-famd-and-clinical-phenotype-clustering-via-hcpc\/\">\u524d\u56de\u306eFAMD\u8a18\u4e8b<\/a>\u3067\u4f5c\u6210\u3057\u305f<code>res_famd<\/code>\uff08FAMD\u306e\u5b9f\u884c\u7d50\u679c\uff09\u3092\u305d\u306e\u307e\u307e\u5f15\u304d\u7d99\u3050\u5f62\u3067\u3001HCPC\u306e\u4e2d\u8eab\u3092\u4e00\u3064\u305a\u3064\u78ba\u8a8d\u3057\u306a\u304c\u3089\u5b9f\u88c5\u3059\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1\uff1aHCPC\u306e\u5b9f\u884c\u3068\u30c7\u30f3\u30c9\u30ed\u30b0\u30e9\u30e0\u306e\u78ba\u8a8d<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>library(FactoMineR)\nlibrary(factoextra)\n\n# HCPC\u306e\u5b9f\u884c\uff08\u30af\u30e9\u30b9\u30bf\u6570\u306f\u81ea\u52d5\u5224\u5b9a\uff09\nres_hcpc &lt;- HCPC(res_famd, nb.clust = -1, consol = TRUE, graph = FALSE)\n\n# \u30c7\u30f3\u30c9\u30ed\u30b0\u30e9\u30e0\u306e\u8868\u793a\nfviz_dend(res_hcpc, show_labels = FALSE, palette = \"jco\", rect = TRUE)\n\n# inertia gain\uff08\u6163\u6027\u306e\u5897\u5206\uff09\u306e\u30d0\u30fc\u30d7\u30ed\u30c3\u30c8\u3067\u3001\u63a8\u5968\u30ab\u30c3\u30c8\u4f4d\u7f6e\u3092\u78ba\u8a8d\nplot(res_hcpc, choice = \"bar\")\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>fviz_dend()<\/code>\u306e\u30c7\u30f3\u30c9\u30ed\u30b0\u30e9\u30e0\u3068\u3001<code>plot(res_hcpc, choice = \"bar\")<\/code>\u306e\u30d0\u30fc\u30d7\u30ed\u30c3\u30c8\u3092\u898b\u6bd4\u3079\u308b\u3053\u3068\u3067\u3001\u300c\u306a\u305c\u3053\u306e\u6570\u306e\u30af\u30e9\u30b9\u30bf\u304c\u63a8\u5968\u3055\u308c\u305f\u306e\u304b\u300d\u3092\u8996\u899a\u7684\u306b\u78ba\u8a8d\u3067\u304d\u308b\u3002\u30d0\u30fc\u30d7\u30ed\u30c3\u30c8\u3067\u6025\u6fc0\u306b\u9ad8\u3055\u304c\u843d\u3061\u8fbc\u3080\u76f4\u524d\u306e\u672c\u6570\u304c\u3001Step\u2462\u3067\u8aac\u660e\u3057\u305f\u300c\u6163\u6027\u306e\u76f8\u5bfe\u7684\u306a\u6e1b\u5c11\u5e45\u304c\u6700\u5927\u306b\u306a\u308b\u5206\u5272\u300d\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"575\" height=\"483\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2026\/09\/image-11.png\" alt=\"\" class=\"wp-image-4811\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2026\/09\/image-11.png 575w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2026\/09\/image-11-300x252.png 300w\" sizes=\"(max-width: 575px) 100vw, 575px\" \/><figcaption class=\"wp-element-caption\">\u30c7\u30f3\u30c9\u30ed\u30b0\u30e9\u30e0<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"575\" height=\"483\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2026\/09\/image-12.png\" alt=\"\" class=\"wp-image-4812\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2026\/09\/image-12.png 575w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2026\/09\/image-12-300x252.png 300w\" sizes=\"(max-width: 575px) 100vw, 575px\" \/><figcaption class=\"wp-element-caption\">\u63a8\u5968\u30ab\u30c3\u30c8\u4f4d\u7f6e\u306f\uff13\u304b\u3089\uff14\u306e\u4f4d\u7f6e<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2\uff1a\u30af\u30e9\u30b9\u30bf\u5e03\u7f6e\u306e\u53ef\u8996\u5316<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u500b\u4f53\uff08\u60a3\u8005\uff09\u3092\u30af\u30e9\u30b9\u30bf\u3054\u3068\u306b\u8272\u5206\u3051\u3057\u3066\u5e03\u7f6e\u3092\u78ba\u8a8d\nfviz_cluster(res_hcpc, geom = \"point\", palette = \"jco\", ellipse.type = \"convex\")\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"575\" height=\"483\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2026\/09\/image-13.png\" alt=\"\" class=\"wp-image-4813\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2026\/09\/image-13.png 575w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2026\/09\/image-13-300x252.png 300w\" sizes=\"(max-width: 575px) 100vw, 575px\" \/><figcaption class=\"wp-element-caption\">\u60a3\u8005\u306e\u30af\u30e9\u30b9\u30bf\u30d7\u30ed\u30c3\u30c8<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3\uff1a<code>desc.var<\/code>\uff08<code>catdes<\/code>\uff09\u306b\u3088\u308b\u30af\u30e9\u30b9\u30bf\u306e\u7279\u5fb4\u3065\u3051<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3057\u3066\u7d42\u308f\u308a\u3067\u306f\u306a\u304f\u3001\u300c\u305d\u306e\u30af\u30e9\u30b9\u30bf\u304c\u81e8\u5e8a\u7684\u306b\u4f55\u3092\u610f\u5473\u3059\u308b\u304b\u300d\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u3001\u8ad6\u6587\u3068\u3057\u3066\u306e\u4fa1\u5024\u3092\u6301\u305f\u305b\u308b\u4e0a\u3067\u6b20\u304b\u305b\u306a\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5404\u30af\u30e9\u30b9\u30bf\u3092\u7279\u5fb4\u3065\u3051\u308b\u5909\u6570\u306e\u78ba\u8a8d\nres_hcpc$desc.var\n\n# \u5404\u30af\u30e9\u30b9\u30bf\u306e\u4e3b\u6210\u5206\u8ef8\u4e0a\u3067\u306e\u7279\u5fb4\u3065\u3051\nres_hcpc$desc.axes\n\n# \u5404\u30af\u30e9\u30b9\u30bf\u306e\u5178\u578b\u7684\u306a\u500b\u4f53\uff08\u30d1\u30e9\u30b4\u30f3\uff09\u306e\u78ba\u8a8d\nres_hcpc$desc.ind$para\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>res_hcpc$desc.var<\/code>\u306f\u3001\u5185\u90e8\u7684\u306b<code>catdes()<\/code>\u95a2\u6570\u3092\u7528\u3044\u3066\u3001\u91cf\u7684\u5909\u6570\u306b\u3064\u3044\u3066\u306f\u30af\u30e9\u30b9\u30bf\u9593\u306e\u5e73\u5747\u5024\u306e\u691c\u5b9a\u3092\u3001\u8cea\u7684\u5909\u6570\u306b\u3064\u3044\u3066\u306f\u30ab\u30c6\u30b4\u30ea\u306e\u51fa\u73fe\u983b\u5ea6\u306e\u691c\u5b9a\u3092\u81ea\u52d5\u7684\u306b\u884c\u3044\u3001\u7d71\u8a08\u7684\u306b\u6709\u610f\u306b\u305d\u306e\u30af\u30e9\u30b9\u30bf\u3092\u7279\u5fb4\u3065\u3051\u3066\u3044\u308b\u5909\u6570\u3092\u4e00\u89a7\u306b\u3057\u3066\u304f\u308c\u308b\u3002\u305f\u3060\u3057\u3001\u3053\u308c\u306f\u5909\u6570\u306e\u6570\u3060\u3051\u691c\u5b9a\u3092\u540c\u6642\u306b\u7e70\u308a\u8fd4\u3059\u591a\u91cd\u691c\u5b9a\u3067\u3042\u308a\u3001\u5909\u6570\u306e\u6570\u304c\u591a\u3044\u307b\u3069\u5076\u7136\u6709\u610f\u306b\u306a\u308b\u5909\u6570\u304c\u7d1b\u308c\u8fbc\u3080\u30ea\u30b9\u30af\uff08\u7b2c\u4e00\u7a2e\u306e\u904e\u8aa4\u306e\u5897\u5927\uff09\u304c\u9ad8\u307e\u308b\u3002\u8ad6\u6587\u3067\u7d50\u679c\u3092\u5831\u544a\u3059\u308b\u969b\u306f\u3001\u3053\u306e\u70b9\u306b\u89e6\u308c\u305f\u3046\u3048\u3067\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u591a\u91cd\u6bd4\u8f03\u306e\u8abf\u6574\u3084\u3001\u81e8\u5e8a\u7684\u306a\u610f\u5473\u3065\u3051\u3068\u306e\u6574\u5408\u6027\u306e\u78ba\u8a8d\u3092\u884c\u3046\u3079\u304d\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7d50\u679c\u306e\u8aad\u307f\u53d6\u308a<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9f\u969b\u306b\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u30014\u3064\u306e\u30af\u30e9\u30b9\u30bf\u304c\u5f97\u3089\u308c\u308b\uff08\u7d50\u679c\u8868\u793a\u306f\u7701\u7565\uff09\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30ab\u30c6\u30b4\u30ea\u5909\u6570\uff08NYHA\uff09\u3068\u30af\u30e9\u30b9\u30bf\u306e\u5bfe\u5fdc<\/strong>\uff1a\u30af\u30e9\u30b9\u30bf\u3068NYHA\u5206\u985e\u306e\u9593\u306b\u306f\u7d71\u8a08\u5b66\u7684\u306b\u6709\u610f\u306a\u95a2\u9023\u304c\u898b\u3089\u308c\uff08P = 2.1\u00d710\u207b\u00b9\u00b2\u00b3\uff09\u3001\u30af\u30e9\u30b9\u30bf1\u301c4\u306f\u305d\u308c\u305e\u308cNYHA I\u301cIV\u306b<code>Cla\/Mod<\/code>\u30fb<code>Mod\/Cla<\/code>\u3068\u3082\u306b100%\u3068\u3044\u3046\u5f62\u3067\u307b\u307c\u5b8c\u5168\u306b\u4e00\u81f4\u3057\u3066\u3044\u305f\u3002\u4eca\u56de\u306fNYHA\u81ea\u4f53\u3092\u91cd\u75c7\u5ea6\u306e\u6f5c\u5728\u5909\u6570\u304b\u3089\u76f4\u63a5\u751f\u6210\u3057\u305f\u7591\u4f3c\u30c7\u30fc\u30bf\u306e\u305f\u3081\u3001\u5b9f\u30c7\u30fc\u30bf\u3067\u3053\u3053\u307e\u3067\u7dba\u9e97\u306b\u4e00\u81f4\u3059\u308b\u3053\u3068\u306f\u901a\u5e38\u306a\u3044\u3002\u3053\u306e\u7d50\u679c\u306f\u3001HCPC\u304c\u91cd\u75c7\u5ea6\u3068\u3044\u3046\u8ef8\u306b\u6cbf\u3063\u3066\u60a3\u8005\u3092\u9069\u5207\u306b\u5206\u96e2\u3067\u304d\u3066\u3044\u308b\u304b\u306e\u30b5\u30cb\u30c6\u30a3\u30c1\u30a7\u30c3\u30af\u3068\u3057\u3066\u8aad\u3080\u306e\u304c\u3088\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u91cf\u7684\u5909\u6570\u306b\u3088\u308b\u30af\u30e9\u30b9\u30bf\u306e\u7279\u5fb4\u3065\u3051<\/strong>\uff1a\u30af\u30e9\u30b9\u30bf\u3092\u6700\u3082\u5f37\u304f\u5224\u5225\u3059\u308b\u306e\u306fBNP\uff08Eta2 = 0.68\uff09\u3001\u6b21\u3044\u3067BMI\uff080.33\uff09\u3001\u5e74\u9f62\uff080.08\uff09\u3067\u3042\u3063\u305f\u3002\u30af\u30e9\u30b9\u30bf\u5225\u306b\u898b\u308b\u3068\u3001\u30af\u30e9\u30b9\u30bf1\uff08NYHA I\uff09\u306fBNP\u304c\u6709\u610f\u306b\u4f4e\u304f\uff0899.4\uff09BMI\u304c\u6709\u610f\u306b\u9ad8\u3044\uff0829.3\uff09\u3001\u30af\u30e9\u30b9\u30bf2\uff08NYHA II\uff09\u306fBNP\u306e\u307f\u6709\u610f\u306b\u4f4e\u3044\uff08205.9\uff09\u3001\u30af\u30e9\u30b9\u30bf3\uff08NYHA III\uff09\u306fBNP\u306b\u306f\u6709\u610f\u5dee\u304c\u306a\u304f\u5e74\u9f62\u304c\u6709\u610f\u306b\u9ad8\u304fBMI\u304c\u6709\u610f\u306b\u4f4e\u3044\u3001\u30af\u30e9\u30b9\u30bf4\uff08NYHA IV\uff09\u306fBNP\u304c\u6709\u610f\u306b\u9ad8\u304f\uff08564.9\uff09\u5e74\u9f62\u3082\u9ad8\u304fBMI\u304c\u4f4e\u3044\u3001\u3068\u3044\u3046\u7279\u5fb4\u304c\u898b\u3089\u308c\u305f\u3002\u5168\u4f53\u3068\u3057\u3066\u306f\u3001BNP\u4e0a\u6607\u30fb\u4f53\u91cd\u6e1b\u5c11\u30fb\u9ad8\u9f62\u5316\u3068\u3044\u3046\u81e8\u5e8a\u7684\u306b\u89e3\u91c8\u3057\u3084\u3059\u3044\u91cd\u75c7\u5ea6\u52fe\u914d\u304c\u3046\u304b\u304c\u3048\u308b\u304c\u3001\u30af\u30e9\u30b9\u30bf3\u3067\u306fBNP\u304c\u6709\u610f\u306a\u5224\u5225\u5909\u6570\u306b\u306a\u3063\u3066\u3044\u306a\u3044\u70b9\u306b\u306f\u7559\u610f\u3055\u308c\u305f\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u4e3b\u6210\u5206\u8ef8\u3068\u30d1\u30e9\u30b4\u30f3<\/strong>\uff1a<code>res_hcpc$desc.axes<\/code>\u3067\u306fDim.3\uff08Eta2 = 0.89\uff09\u3068Dim.1\uff080.86\uff09\u304c\u30af\u30e9\u30b9\u30bf\u5206\u96e2\u306b\u6700\u3082\u5f37\u304f\u5bc4\u4e0e\u3057\u3066\u3044\u305f\u3002\u307e\u305f<code>res_hcpc$desc.ind$para<\/code>\u306f\u5404\u30af\u30e9\u30b9\u30bf\u306e\u91cd\u5fc3\u306b\u6700\u3082\u8fd1\u3044\u500b\u4f53\uff08\u30d1\u30e9\u30b4\u30f3\uff09\u3092\u793a\u3057\u3066\u304a\u308a\u3001\u305d\u306e\u60a3\u8005ID\u3092\u5b9f\u969b\u306e\u30ab\u30eb\u30c6\u3068\u7a81\u304d\u5408\u308f\u305b\u308c\u3070\u3001\u4ee3\u8868\u75c7\u4f8b\u3068\u3057\u3066\u75c7\u4f8b\u63d0\u793a\u306b\u6d3b\u7528\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4\uff1ak-means\u518d\u8abf\u6574\u306b\u3088\u308b\u518d\u5272\u5f53\u5272\u5408\u306e\u7b97\u51fa<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cResults\u300d\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u5831\u544a\u3059\u308b\u300ck-means\u518d\u8abf\u6574\u306b\u3088\u3063\u3066\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306e\u521d\u671f\u5206\u5272\u304b\u3089\u518d\u5272\u5f53\u3055\u308c\u305f\u500b\u4f53\u306e\u5272\u5408\u300d\u306f\u3001<code>consol = TRUE<\/code>\uff08\u518d\u8abf\u6574\u3042\u308a\uff09\u3068<code>consol = FALSE<\/code>\uff08\u518d\u8abf\u6574\u306a\u3057\u3001\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u5358\u4f53\u306e\u7d50\u679c\uff09\u3092\u5225\u3005\u306b\u5b9f\u884c\u3057\u3001\u4e21\u8005\u306e\u6240\u5c5e\u30af\u30e9\u30b9\u30bf\u3092\u6bd4\u8f03\u3059\u308b\u3053\u3068\u3067\u7b97\u51fa\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u518d\u8abf\u6574\u3042\u308a\uff08\u65e2\u5b9a\uff09\nres_hcpc_consol &lt;- HCPC(res_famd, nb.clust = -1, consol = TRUE, graph = FALSE)\n\n# \u518d\u8abf\u6574\u306a\u3057\uff08\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u5358\u4f53\u306e\u7d50\u679c\uff09\nres_hcpc_raw &lt;- HCPC(res_famd, nb.clust = -1, consol = FALSE, graph = FALSE)\n\n# \u4e21\u8005\u306e\u6240\u5c5e\u30af\u30e9\u30b9\u30bf\u3092\u6bd4\u8f03\u3057\u3001\u518d\u5272\u5f53\u3055\u308c\u305f\u500b\u4f53\u306e\u5272\u5408\u3092\u7b97\u51fa\nreassigned &lt;- res_hcpc_consol$data.clust$clust != res_hcpc_raw$data.clust$clust\nreassign_rate &lt;- mean(reassigned) * 100\ncat(sprintf(\"k-means\u518d\u8abf\u6574\u306b\u3088\u308b\u518d\u5272\u5f53\u7387: %.1f%%\\n\", reassign_rate))\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u88dc\u8db3\uff1a\u5927\u898f\u6a21\u30c7\u30fc\u30bf\u3092\u60f3\u5b9a\u3057\u305f<code>kk<\/code>\u5f15\u6570\u306e\u4f7f\u7528\u4f8b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>kk = 100 <\/code>\u3068\u3044\u3046\u5f15\u6570\u3092\u8db3\u3059\u3053\u3068\u3067\u3001\u4e8b\u524d\u306bk-means\u3067100\u500b\u306e\u4ee3\u8868\u70b9\u306b\u96c6\u7d04\u3057\u3066\u304b\u3089\u6728\uff08\u30c7\u30f3\u30c9\u30ed\u30b0\u30e9\u30e0\uff09\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u3001\u5927\u898f\u6a21\u30c7\u30fc\u30bf\u3067\u3082\u8a08\u7b97\u8ca0\u8377\u3092\u6291\u3048\u3089\u308c\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u75c7\u4f8b\u6570\u304c\u975e\u5e38\u306b\u591a\u3044\u5834\u5408\u3092\u60f3\u5b9a\u3057\u305fHCPC\uff08kk\u5f15\u6570\u3067\u4e8b\u524d\u96c6\u7d04\uff09\nres_hcpc_big &lt;- HCPC(res_famd, kk = 100, nb.clust = -1, consol = FALSE, graph = FALSE)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">5. \u8ad6\u6587\u3067\u305d\u306e\u307e\u307e\u4f7f\u3048\u308b\u82f1\u6587\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\uff08Methods &amp; Results\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Methods \u30bb\u30af\u30b7\u30e7\u30f3\u82f1\u6587\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u201cHierarchical clustering on principal components (HCPC) was performed using Ward&#8217;s criterion on the retained FAMD dimensions. The number of clusters was determined based on the relative loss of within-cluster inertia, and the initial partition was subsequently refined using k-means consolidation. Clusters were characterized using quantitative and categorical variable description (catdes).\u201d<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Results \u30bb\u30af\u30b7\u30e7\u30f3\u82f1\u6587\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u201cHCPC identified four clusters based on the maximal relative loss of within-cluster inertia. Following k-means consolidation, none of individuals were reassigned from their initial hierarchical cluster assignment. The resulting clusters differed significantly in baseline age, BMI, BNP levels, and NYHA functional class distribution (P &lt; 0.001).\u201d<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\uff08\u4e0a\u8a18\u306e\u30af\u30e9\u30b9\u30bf\u6570\u30fb\u518d\u5272\u5f53\u5272\u5408\u30fbP\u5024\u7b49\u306e\u6570\u5024\u306f\u3042\u304f\u307e\u3067\u8a18\u8ff0\u4f8b\u3067\u3042\u308a\u3001\u5b9f\u969b\u306e\u89e3\u6790\u7d50\u679c\u306b\u7f6e\u304d\u63db\u3048\u3066\u4f7f\u7528\u3055\u308c\u305f\u3044\u3002\uff09<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. \u307e\u3068\u3081\uff06\u4e00\u62ec\u30b3\u30d4\u30da\u7528R\u30b9\u30af\u30ea\u30d7\u30c8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8\u304a\u3055\u3089\u3044<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>HCPC\u306f\u300c\u4e3b\u6210\u5206\u306b\u5bfe\u3057\u3066\u884c\u3046\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u300d<\/strong>\uff1a\u751f\u30c7\u30fc\u30bf\u306e\u307e\u307e<code>hclust()<\/code>\u306b\u304b\u3051\u308b\u306e\u3067\u306f\u306a\u304f\u3001FAMD\/PCA\u3067\u30ce\u30a4\u30ba\u3092\u843d\u3068\u3057\u3066\u304b\u3089\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3092\u884c\u3046\u70b9\u304c\u672c\u8cea\u7684\u306a\u9055\u3044\u3067\u3042\u308b\u3002<\/li>\n\n\n\n<li><strong><code>nb.clust = -1<\/code>\u306e\u6b63\u4f53\u306f\u300c\u6163\u6027\u306e\u76f8\u5bfe\u7684\u306a\u6e1b\u5c11\u5e45\u304c\u6700\u5927\u306b\u306a\u308b\u5206\u5272\u300d\u306e\u81ea\u52d5\u691c\u51fa<\/strong>\uff1a\u30d6\u30e9\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3067\u306f\u306a\u304f\u3001\u660e\u78ba\u306a\u7d71\u8a08\u7684\u57fa\u6e96\u306b\u57fa\u3065\u3044\u3066\u3044\u308b\u3002<\/li>\n\n\n\n<li><strong>\u6700\u7d42\u7d50\u679c\u304c\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u5358\u4f53\u3068\u30ba\u30ec\u308b\u306e\u306f\u3001k-means\u306b\u3088\u308b\u518d\u8abf\u6574\uff08<code>consol<\/code>\uff09\u306e\u305f\u3081<\/strong>\uff1a\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306e\u521d\u671f\u5206\u5272\u3092\u3001k-means\u3067\u5f8c\u304b\u3089\u5fae\u8abf\u6574\u3057\u3066\u3044\u308b\u3002<\/li>\n\n\n\n<li><strong>\u5927\u898f\u6a21\u30c7\u30fc\u30bf\u3067\u306f<code>kk<\/code>\u5f15\u6570\u306b\u3088\u308b\u4e8b\u524d\u96c6\u7d04\u304c\u6709\u52b9<\/strong>\uff1a\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u306e\u524d\u306bk-means\u3067\u4ee3\u8868\u70b9\u3092\u4f5c\u308b\u3053\u3068\u3067\u3001\u8ddd\u96e2\u884c\u5217\u306e\u80a5\u5927\u5316\u306b\u3088\u308b\u30e1\u30e2\u30ea\u30a8\u30e9\u30fc\u3092\u56de\u907f\u3067\u304d\u308b\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e00\u62ec\u5b9f\u884c\u7528R\u30b9\u30af\u30ea\u30d7\u30c8<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># ==============================================================================\n# HCPC\uff08\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u30fb\u30aa\u30f3\u30fb\u30d7\u30ea\u30f3\u30b7\u30d1\u30eb\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c4\uff09\u4e00\u62ec\u5b9f\u884c\u30b9\u30af\u30ea\u30d7\u30c8\n# \u524d\u63d0\uff1a\u524d\u56de\u306eFAMD\u8a18\u4e8b\u306e res_famd \u304c\u3059\u3067\u306b\u4f5c\u6210\u6e08\u307f\u3067\u3042\u308b\u3053\u3068\n# \u30d1\u30c3\u30b1\u30fc\u30b8: FactoMineR, factoextra\n# ==============================================================================\n\nlibrary(FactoMineR)\nlibrary(factoextra)\n\n# 1. HCPC\u306e\u5b9f\u884c\uff08\u30af\u30e9\u30b9\u30bf\u6570\u306f\u81ea\u52d5\u5224\u5b9a\u3001k-means\u518d\u8abf\u6574\u3042\u308a\uff09\ncat(\"\\n--- HCPC \u5b9f\u884c ---\\n\")\nres_hcpc &lt;- HCPC(res_famd, nb.clust = -1, consol = TRUE, graph = FALSE)\n\n# 2. \u30c7\u30f3\u30c9\u30ed\u30b0\u30e9\u30e0\u3068 inertia gain \u30d0\u30fc\u30d7\u30ed\u30c3\u30c8\u306e\u8868\u793a\np_dend &lt;- fviz_dend(res_hcpc, show_labels = FALSE, palette = \"jco\", rect = TRUE)\nprint(p_dend)\nplot(res_hcpc, choice = \"bar\")\n\n# 3. \u30af\u30e9\u30b9\u30bf\u5e03\u7f6e\u306e\u53ef\u8996\u5316\np_cluster &lt;- fviz_cluster(res_hcpc, geom = \"point\", palette = \"jco\", ellipse.type = \"convex\")\nprint(p_cluster)\n\n# 4. \u30af\u30e9\u30b9\u30bf\u306e\u7279\u5fb4\u3065\u3051\ncat(\"\\n--- \u30af\u30e9\u30b9\u30bf\u7279\u5fb4\u91cf\u306e\u78ba\u8a8d ---\\n\")\nprint(res_hcpc$desc.var)\nprint(res_hcpc$desc.axes)\n\n# 5. \u5927\u898f\u6a21\u30c7\u30fc\u30bf\u3092\u60f3\u5b9a\u3057\u305f kk \u5f15\u6570\u306b\u3088\u308b\u4e8b\u524d\u96c6\u7d04\uff08\u75c7\u4f8b\u6570\u304c\u975e\u5e38\u306b\u591a\u3044\u5834\u5408\uff09\nres_hcpc_big &lt;- HCPC(res_famd, kk = 100, nb.clust = -1, consol = FALSE, graph = FALSE)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u304a\u3059\u3059\u3081\u66f8\u7c4d<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/amzn.to\/46yrdlc\">R\u3067\u5b66\u3076\u30af\u30e9\u30b9\u30bf\u89e3\u6790<\/a>\uff08\u65b0\u7d0d\u6d69\u5e78 \u8457\uff09\uff1a\u968e\u5c64\u7684\u30af\u30e9\u30b9\u30bf\u30ea\u30f3\u30b0\u3084k-means\u6cd5\u306a\u3069\u306e\u57fa\u672c\u624b\u6cd5\u306b\u52a0\u3048\u3001\u9ad8\u6b21\u5143\u30c7\u30fc\u30bf\u306e\u6b21\u5143\u5727\u7e2e\u624b\u6cd5\u3082\u6271\u3063\u3066\u304a\u308a\u3001\u672c\u8a18\u4e8b\u306e\u30c6\u30fc\u30de\u3068\u76f8\u6027\u304c\u3088\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306e\u8a18\u4e8b\u3067\u306f\u3001\u91cf\u7684\u5909\u6570\u3068\u8cea\u7684\u5909\u6570\u304c\u6df7\u5728\u3059\u308b\u60a3\u8005\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066FAMD\u3067\u6b21\u5143\u3092\u7e2e\u7d04\u3057\u3001\u305d\u306e\u4e3b\u6210\u5206\u306b\u5bfe\u3057\u3066HCPC\uff08Hierarchical Clustering on Principal Components\uff09\u3067\u81e8\u5e8a\u8868\u73fe [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":4811,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[107],"tags":[],"class_list":["post-4810","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-107"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2026\/09\/image-11.png","_links":{"self":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4810","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/comments?post=4810"}],"version-history":[{"count":6,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4810\/revisions"}],"predecessor-version":[{"id":4819,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/4810\/revisions\/4819"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media\/4811"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=4810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=4810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=4810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}