{"id":1274,"date":"2024-07-18T06:38:26","date_gmt":"2024-07-18T06:38:26","guid":{"rendered":"http:\/\/www.statdc.com\/?p=1274"},"modified":"2025-06-11T01:23:00","modified_gmt":"2025-06-11T01:23:00","slug":"%ea%b3%84%ec%b8%b5%ec%a0%81-%ed%9a%8c%ea%b7%80%eb%b6%84%ec%84%9dhierarchical-regression-analysis","status":"publish","type":"post","link":"http:\/\/www.inmining.co.kr\/?p=1274","title":{"rendered":"\uacc4\uce35\uc801 \ud68c\uadc0\ubd84\uc11d(Hierarchical Regression Analysis)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\uacc4\uce35\uc801 \ud68c\uadc0\ubd84\uc11d(Hierarchical Regression Analysis)\uc740 \uc5ec\ub7ec \ub2e8\uacc4\uc5d0 \uac78\uccd0 \ub3c5\ub9bd \ubcc0\uc218\ub97c \ucd94\uac00\ud558\uba74\uc11c \uac01 \ub2e8\uacc4\ub9c8\ub2e4 \ubaa8\ud615\uc758 \uc801\ud569\ub3c4\ub97c \ud3c9\uac00\ud558\ub294 \ud68c\uadc0 \ubd84\uc11d \uae30\ubc95\uc785\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \uac01 \ub3c5\ub9bd \ubcc0\uc218\uac00 \uc885\uc18d \ubcc0\uc218\uc5d0 \ubbf8\uce58\ub294 \uc601\ud5a5\uc744 \ub2e8\uacc4\ubcc4\ub85c \ud3c9\uac00\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uacc4\uce35\uc801 \ud68c\uadc0\ubd84\uc11d\uc740 \uc8fc\ub85c \ubcc0\uc218 \uac04\uc758 \uad00\uacc4\ub97c \uc774\ud574\ud558\uace0, \uac01 \ubcc0\uc218\uc758 \ucd94\uac00\uc801\uc778 \uc124\uba85\ub825\uc744 \ud655\uc778\ud558\ub294 \ub370 \uc0ac\uc6a9\ub429\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%EC%A3%BC%EC%9A%94_%EB%8B%A8%EA%B3%84\"><\/span>\uc8fc\uc694 \ub2e8\uacc4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">1. <strong>\uae30\ubcf8 \ubaa8\ud615 \uc124\uc815<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uccab \ubc88\uc9f8 \ub2e8\uacc4\uc5d0\uc11c\ub294 \uae30\ucd08 \ubcc0\uc218\ub97c \ud3ec\ud568\ud55c \uae30\ubcf8 \ubaa8\ud615\uc744 \uc124\uc815\ud569\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, \ud1b5\uc81c \ubcc0\uc218\ub97c \uba3c\uc800 \ud3ec\ud568\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">2. <strong>\uc0c8\ub85c\uc6b4 \ubcc0\uc218 \ucd94\uac00<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\ub2e4\uc74c \ub2e8\uacc4\uc5d0\uc11c\ub294 \uc0c8\ub85c\uc6b4 \ub3c5\ub9bd \ubcc0\uc218\ub97c \ucd94\uac00\ud558\uc5ec \ubaa8\ud615\uc744 \ud655\uc7a5\ud569\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \uc0c8\ub85c\uc6b4 \ubcc0\uc218\uac00 \uc885\uc18d \ubcc0\uc218\uc5d0 \ubbf8\uce58\ub294 \ucd94\uac00\uc801\uc778 \uc124\uba85\ub825\uc744 \ud3c9\uac00\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">3. <strong>\ubaa8\ud615 \ube44\uad50<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uac01 \ub2e8\uacc4\ub9c8\ub2e4 \uacb0\uc815 \uacc4\uc218(R\u00b2)\uc640 \uac19\uc740 \uc801\ud569\ub3c4 \uc9c0\ud45c\ub97c \ube44\uad50\ud558\uc5ec \uc0c8\ub85c\uc6b4 \ubcc0\uc218\uc758 \ucd94\uac00\uac00 \ubaa8\ud615\uc758 \uc124\uba85\ub825\uc744 \uc5bc\ub9c8\ub098 \ud5a5\uc0c1\uc2dc\ud0a4\ub294\uc9c0 \ud3c9\uac00\ud569\ub2c8\ub2e4.<\/li>\n\n\n\n<li>F-\uac80\uc815\uc774\ub098 \ubcc0\ud654\ub41c R\u00b2\uc758 \uc720\uc758\uc131 \uac80\uc815\uc744 \ud1b5\ud574 \uac01 \ub2e8\uacc4\uc758 \ubaa8\ud615\uc774 \uc774\uc804 \ubaa8\ud615\uc5d0 \ube44\ud574 \uc720\uc758\ud558\uac8c \ub098\uc740\uc9c0 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%EC%98%88%EC%8B%9C\"><\/span>\uc608\uc2dc<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>1\ub2e8\uacc4<\/strong>: \uc778\uad6c \ud1b5\uacc4\ud559\uc801 \ubcc0\uc218(\ub098\uc774, \uc131\ubcc4 \ub4f1)\ub97c \ud3ec\ud568\ud55c \uae30\ubcf8 \ubaa8\ud615<\/li>\n\n\n\n<li><strong>2\ub2e8\uacc4<\/strong>: \uc5ec\uae30\uc5d0 \uc0ac\ud68c\uacbd\uc81c\uc801 \ubcc0\uc218(\uc18c\ub4dd, \uad50\uc721 \uc218\uc900 \ub4f1)\ub97c \ucd94\uac00<\/li>\n\n\n\n<li><strong>3\ub2e8\uacc4<\/strong>: \ucd94\uac00\ub85c \uc2ec\ub9ac\uc801 \ubcc0\uc218(\uc2a4\ud2b8\ub808\uc2a4 \uc218\uc900, \uc0b6\uc758 \ub9cc\uc871\ub3c4 \ub4f1)\ub97c \ud3ec\ud568<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%EB%B6%84%EC%84%9D_%EC%A0%88%EC%B0%A8\"><\/span>\ubd84\uc11d \uc808\ucc28<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\ub370\uc774\ud130 \uc900\ube44<\/strong>:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\ubd84\uc11d\uc5d0 \uc0ac\uc6a9\ud560 \ub370\uc774\ud130\ub97c \uc815\ub9ac\ud558\uace0, \uacb0\uce21\uac12\uc744 \ucc98\ub9ac\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\ubaa8\ud615 \uad6c\ucd95<\/strong>:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uae30\ubcf8 \ubaa8\ud615\uc744 \uc124\uc815\ud558\uace0, \uc810\ucc28\uc801\uc73c\ub85c \ub3c5\ub9bd \ubcc0\uc218\ub97c \ucd94\uac00\ud558\ub294 \ubc29\uc2dd\uc73c\ub85c \uacc4\uce35\uc801 \ubaa8\ud615\uc744 \uad6c\ucd95\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\ud68c\uadc0\ubd84\uc11d \uc218\ud589<\/strong>:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uac01 \ub2e8\uacc4\ub9c8\ub2e4 \ud68c\uadc0\ubd84\uc11d\uc744 \uc218\ud589\ud558\uace0, \uc801\ud569\ub3c4 \uc9c0\ud45c\ub97c \uae30\ub85d\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\uacb0\uacfc \ud574\uc11d<\/strong>:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uac01 \ub2e8\uacc4\ubcc4\ub85c R\u00b2, \ubcc0\ud654\ub41c R\u00b2, F-\uac80\uc815 \uacb0\uacfc \ub4f1\uc744 \ube44\uad50\ud558\uc5ec \ubcc0\uc218\uc758 \ucd94\uac00\uc801\uc778 \uc124\uba85\ub825\uc744 \ud3c9\uac00\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%EC%BD%94%EB%93%9C_%EC%98%88%EC%A0%9C_Python_%E2%80%93_Statsmodels_%ED%99%9C%EC%9A%A9\"><\/span>\ucf54\ub4dc \uc608\uc81c (Python &#8211; Statsmodels \ud65c\uc6a9)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\uc544\ub798\ub294 Python\uc744 \uc0ac\uc6a9\ud558\uc5ec \uacc4\uce35\uc801 \ud68c\uadc0\ubd84\uc11d\uc744 \uc218\ud589\ud558\ub294 \uc608\uc81c \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import pandas as pd\nimport statsmodels.api as sm\n\n# \uc608\uc2dc \ub370\uc774\ud130 \uc0dd\uc131\ndata = {\n    'age': &#91;23, 45, 31, 35, 46],\n    'gender': &#91;1, 0, 0, 1, 0],\n    'income': &#91;50000, 60000, 55000, 65000, 70000],\n    'education': &#91;12, 16, 14, 18, 20],\n    'stress_level': &#91;5, 6, 4, 7, 8],\n    'life_satisfaction': &#91;7, 8, 6, 9, 7]\n}\ndf = pd.DataFrame(data)\n\n# 1\ub2e8\uacc4: \uc778\uad6c \ud1b5\uacc4\ud559\uc801 \ubcc0\uc218 \ud3ec\ud568\nX1 = df&#91;&#91;'age', 'gender']]\nX1 = sm.add_constant(X1)\nmodel1 = sm.OLS(df&#91;'life_satisfaction'], X1).fit()\nprint(model1.summary())\n\n# 2\ub2e8\uacc4: \uc0ac\ud68c\uacbd\uc81c\uc801 \ubcc0\uc218 \ucd94\uac00\nX2 = df&#91;&#91;'age', 'gender', 'income', 'education']]\nX2 = sm.add_constant(X2)\nmodel2 = sm.OLS(df&#91;'life_satisfaction'], X2).fit()\nprint(model2.summary())\n\n# 3\ub2e8\uacc4: \uc2ec\ub9ac\uc801 \ubcc0\uc218 \ucd94\uac00\nX3 = df&#91;&#91;'age', 'gender', 'income', 'education', 'stress_level']]\nX3 = sm.add_constant(X3)\nmodel3 = sm.OLS(df&#91;'life_satisfaction'], X3).fit()\nprint(model3.summary())<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc704\uc758 \ucf54\ub4dc\ub97c \uc2e4\ud589\ud558\uba74 \uac01 \ub2e8\uacc4\ubcc4 \ud68c\uadc0\ubd84\uc11d \uacb0\uacfc\uac00 \ucd9c\ub825\ub429\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \uac01 \ub2e8\uacc4\uc5d0\uc11c \ucd94\uac00\ub41c \ubcc0\uc218\ub4e4\uc774 \uc885\uc18d \ubcc0\uc218\uc5d0 \ubbf8\uce58\ub294 \uc601\ud5a5\uc744 \ud655\uc778\ud558\uace0, \ubaa8\ud615\uc758 \uc124\uba85\ub825\uc774 \uc5b4\ub5bb\uac8c \ubcc0\ud654\ud558\ub294\uc9c0 \ud3c9\uac00\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uacc4\uce35\uc801 \ud68c\uadc0\ubd84\uc11d(Hierarchical Regression Analysis)\uc740 \uc5ec\ub7ec \ub2e8\uacc4\uc5d0 \uac78\uccd0 \ub3c5\ub9bd \ubcc0\uc218\ub97c \ucd94\uac00\ud558\uba74\uc11c \uac01 \ub2e8\uacc4\ub9c8\ub2e4 \ubaa8\ud615\uc758 \uc801\ud569\ub3c4\ub97c \ud3c9\uac00\ud558\ub294 \ud68c\uadc0 \ubd84\uc11d \uae30\ubc95\uc785\ub2c8\ub2e4&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":1278,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1274","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stat","wpcat-6-id"],"_links":{"self":[{"href":"http:\/\/www.inmining.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.inmining.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.inmining.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.inmining.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.inmining.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1274"}],"version-history":[{"count":1,"href":"http:\/\/www.inmining.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1274\/revisions"}],"predecessor-version":[{"id":1275,"href":"http:\/\/www.inmining.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1274\/revisions\/1275"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.inmining.co.kr\/index.php?rest_route=\/wp\/v2\/media\/1278"}],"wp:attachment":[{"href":"http:\/\/www.inmining.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.inmining.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1274"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.inmining.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}