{"id":85,"date":"2023-07-22T10:08:25","date_gmt":"2023-07-22T10:08:25","guid":{"rendered":"https:\/\/ungdung.hotronghiencuu.com\/open\/?p=85"},"modified":"2023-07-22T17:08:25","modified_gmt":"2023-07-22T10:08:25","slug":"cac-lenh-tren-stata-phan-2","status":"publish","type":"post","link":"https:\/\/ungdung.hotronghiencuu.com\/open\/cac-lenh-tren-stata-phan-2","title":{"rendered":"C\u00e1c l\u1ec7nh tr\u00ean Stata- Ph\u1ea7n 2: H\u1ed3i quy d\u1eef li\u1ec7u b\u1ea3ng"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_40 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" area-label=\"ez-toc-toggle-icon-1\"><label for=\"item-6b1378b4f0ece\" aria-label=\"Table of Content\"><span style=\"display: flex;align-items: center;width: 35px;height: 30px;justify-content: center;direction:ltr;\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/label><input  type=\"checkbox\" id=\"item-6b1378b4f0ece\"><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ungdung.hotronghiencuu.com\/open\/cac-lenh-tren-stata-phan-2\/#Cac_lenh_hoi_quy_du_lieu_bang_trong_stata\" title=\"C\u00e1c l\u1ec7nh h\u1ed3i quy d\u1eef li\u1ec7u b\u1ea3ng trong stata\">C\u00e1c l\u1ec7nh h\u1ed3i quy d\u1eef li\u1ec7u b\u1ea3ng trong stata<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ungdung.hotronghiencuu.com\/open\/cac-lenh-tren-stata-phan-2\/#Lenh_hoi_quy_mo_hinh_FEM_trong_stata\" title=\"L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh FEM trong stata\">L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh FEM trong stata<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ungdung.hotronghiencuu.com\/open\/cac-lenh-tren-stata-phan-2\/#Lenh_hoi_quy_mo_hinh_REM_trong_stata\" title=\"L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh REM trong stata\">L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh REM trong stata<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ungdung.hotronghiencuu.com\/open\/cac-lenh-tren-stata-phan-2\/#Lenh_hoi_quy_mo_hinh_Pool-OLS_trong_stata\" title=\"L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh Pool-OLS trong stata\">L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh Pool-OLS trong stata<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ungdung.hotronghiencuu.com\/open\/cac-lenh-tren-stata-phan-2\/#Lenh_hoi_quy_mo_hinh_GLS_trong_stata\" title=\"L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh GLS trong stata\">L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh GLS trong stata<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Cac_lenh_hoi_quy_du_lieu_bang_trong_stata\"><\/span>C\u00e1c l\u1ec7nh h\u1ed3i quy d\u1eef li\u1ec7u b\u1ea3ng trong stata<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Trong Stata, \u0111\u1ec3 th\u1ef1c hi\u1ec7n h\u1ed3i quy d\u1eef li\u1ec7u b\u1ea3ng, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh &#8220;regress&#8221;. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 c\u00fa ph\u00e1p v\u00e0 c\u00e1c t\u00f9y ch\u1ecdn ph\u1ed5 bi\u1ebfn c\u1ee7a l\u1ec7nh n\u00e0y:<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\">regress dependent_var independent_var1 independent_var2 ...<br \/>\n<\/code><\/div>\n<\/div>\n<p>Trong \u0111\u00f3:<\/p>\n<ul>\n<li>&#8220;dependent_var&#8221; l\u00e0 bi\u1ebfn ph\u1ee5 thu\u1ed9c (outcome variable) m\u00e0 b\u1ea1n mu\u1ed1n d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch.<\/li>\n<li>&#8220;independent_var1, independent_var2, &#8230;&#8221; l\u00e0 c\u00e1c bi\u1ebfn \u0111\u1ed9c l\u1eadp (independent variables) m\u00e0 b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch bi\u1ebfn ph\u1ee5 thu\u1ed9c.<\/li>\n<\/ul>\n<p>Ngo\u00e0i ra, b\u1ea1n c\u0169ng c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng c\u00e1c t\u00f9y ch\u1ecdn sau \u0111\u1ec3 \u0111i\u1ec1u ch\u1ec9nh ph\u00e2n t\u00edch h\u1ed3i quy d\u1eef li\u1ec7u b\u1ea3ng tr\u00ean Stata:<\/p>\n<ul>\n<li><code>robust<\/code>: T\u00ednh to\u00e1n c\u00e1c \u01b0\u1edbc l\u01b0\u1ee3ng h\u1ed3i quy robust s\u1eed d\u1ee5ng ph\u01b0\u01a1ng ph\u00e1p Huber-White \u0111\u1ec3 \u0111i\u1ec1u ch\u1ec9nh cho sai s\u1ed1 kh\u00f4ng \u0111\u1ed3ng nh\u1ea5t v\u00e0 vi ph\u1ea1m gi\u1ea3 \u0111\u1ecbnh v\u1ec1 ph\u01b0\u01a1ng sai.<\/li>\n<li><code>cluster(varname)<\/code>: T\u00ednh to\u00e1n c\u00e1c \u01b0\u1edbc l\u01b0\u1ee3ng h\u1ed3i quy cluster-standard errors, s\u1eed d\u1ee5ng m\u00f4 h\u00ecnh t\u01b0\u01a1ng t\u1ef1 robust nh\u01b0ng ch\u1ec9 t\u00ednh to\u00e1n sai s\u1ed1 chu\u1ea9n theo c\u1ee5m.<\/li>\n<li><code>vce(robust)<\/code>: T\u01b0\u01a1ng \u0111\u01b0\u01a1ng v\u1edbi <code>robust<\/code>.<\/li>\n<li><code>vce(cluster varname)<\/code>: T\u01b0\u01a1ng \u0111\u01b0\u01a1ng v\u1edbi <code>cluster(varname)<\/code>.<\/li>\n<li><code>noconstant<\/code>: Lo\u1ea1i b\u1ecf h\u1ea1ng t\u1ef1 do h\u1eb1ng s\u1ed1 (intercept) trong m\u00f4 h\u00ecnh h\u1ed3i quy.<\/li>\n<\/ul>\n<p>V\u00ed d\u1ee5:<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\">regress y x1 x2<br \/>\n<\/code><\/div>\n<\/div>\n<p>Trong v\u00ed d\u1ee5 n\u00e0y, &#8220;y&#8221; l\u00e0 bi\u1ebfn ph\u1ee5 thu\u1ed9c, v\u00e0 &#8220;x1&#8221; v\u00e0 &#8220;x2&#8221; l\u00e0 c\u00e1c bi\u1ebfn \u0111\u1ed9c l\u1eadp. L\u1ec7nh tr\u00ean s\u1ebd th\u1ef1c hi\u1ec7n h\u1ed3i quy \u0111a bi\u1ebfn c\u1ee7a bi\u1ebfn &#8220;y&#8221; tr\u00ean &#8220;x1&#8221; v\u00e0 &#8220;x2&#8221;.<\/p>\n<p>L\u01b0u \u00fd r\u1eb1ng c\u00e1c t\u00f9y ch\u1ecdn v\u00e0 c\u00fa ph\u00e1p c\u1ee5 th\u1ec3 c\u00f3 th\u1ec3 thay \u0111\u1ed5i t\u00f9y thu\u1ed9c v\u00e0o m\u1ee5c ti\u00eau nghi\u00ean c\u1ee9u v\u00e0 lo\u1ea1i d\u1eef li\u1ec7u m\u00e0 b\u1ea1n \u0111ang l\u00e0m vi\u1ec7c.<\/p>\n<p>Xem th\u00eam: <a href=\"https:\/\/ungdung.hotronghiencuu.com\/open\/tai-va-cai-dat-stata-mien-phi-download-stata\" rel=\"bookmark\">T\u1ea3i v\u00e0 c\u00e0i \u0111\u1eb7t Stata mi\u1ec5n ph\u00ed- Download Stata<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Lenh_hoi_quy_mo_hinh_FEM_trong_stata\"><\/span>L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh FEM trong stata<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Trong Stata, \u0111\u1ec3 th\u1ef1c hi\u1ec7n m\u00f4 h\u00ecnh h\u1ed3i quy Fixed Effects (FE) ho\u1eb7c Fixed Effects with Time Dummies (FEM), b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh &#8220;xtreg&#8221; ho\u1eb7c &#8220;areg&#8221;. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 c\u00fa ph\u00e1p v\u00e0 c\u00e1c t\u00f9y ch\u1ecdn ph\u1ed5 bi\u1ebfn cho m\u1ed7i l\u1ec7nh:<\/p>\n<ol>\n<li>S\u1eed d\u1ee5ng l\u1ec7nh &#8220;xtreg&#8221;:<\/li>\n<\/ol>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\">xtreg dependent_var independent_var1 independent_var2 ..., fe<br \/>\n<\/code><\/div>\n<\/div>\n<p>ho\u1eb7c<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\">css<\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-css\">xtreg dependent_var independent_var1 independent_var2 ..., <span class=\"hljs-selector-tag\">i<\/span>(panel_var), fe<br \/>\n<\/code><\/div>\n<\/div>\n<p>Trong \u0111\u00f3:<\/p>\n<ul>\n<li>&#8220;dependent_var&#8221; l\u00e0 bi\u1ebfn ph\u1ee5 thu\u1ed9c (outcome variable) m\u00e0 b\u1ea1n mu\u1ed1n d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch.<\/li>\n<li>&#8220;independent_var1, independent_var2, &#8230;&#8221; l\u00e0 c\u00e1c bi\u1ebfn \u0111\u1ed9c l\u1eadp (independent variables) m\u00e0 b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch bi\u1ebfn ph\u1ee5 thu\u1ed9c.<\/li>\n<li>&#8220;fe&#8221; l\u00e0 t\u00f9y ch\u1ecdn cho Fixed Effects, cho bi\u1ebft b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng m\u00f4 h\u00ecnh h\u1ed3i quy v\u1edbi hi\u1ec7u \u1ee9ng c\u1ed1 \u0111\u1ecbnh.<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>S\u1eed d\u1ee5ng l\u1ec7nh &#8220;areg&#8221;:<\/li>\n<\/ol>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\">scss<\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-scss\">areg dependent_var independent_var1 independent_var2 ..., <span class=\"hljs-built_in\">absorb<\/span>(panel_var)<br \/>\n<\/code><\/div>\n<\/div>\n<p>Trong \u0111\u00f3:<\/p>\n<ul>\n<li>&#8220;dependent_var&#8221; l\u00e0 bi\u1ebfn ph\u1ee5 thu\u1ed9c (outcome variable) m\u00e0 b\u1ea1n mu\u1ed1n d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch.<\/li>\n<li>&#8220;independent_var1, independent_var2, &#8230;&#8221; l\u00e0 c\u00e1c bi\u1ebfn \u0111\u1ed9c l\u1eadp (independent variables) m\u00e0 b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch bi\u1ebfn ph\u1ee5 thu\u1ed9c.<\/li>\n<li>&#8220;panel_var&#8221; l\u00e0 bi\u1ebfn \u0111\u1ea1i di\u1ec7n cho \u0111\u1eb7c \u0111i\u1ec3m c\u1ed1 \u0111\u1ecbnh (fixed effects) m\u00e0 b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng trong m\u00f4 h\u00ecnh.<\/li>\n<\/ul>\n<p>V\u00ed d\u1ee5:<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\">xtreg y x1 x2, fe<br \/>\n<\/code><\/div>\n<\/div>\n<p>ho\u1eb7c<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\">scss<\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-scss\">areg y x1 x2, <span class=\"hljs-built_in\">absorb<\/span>(panel_var)<br \/>\n<\/code><\/div>\n<\/div>\n<p>L\u01b0u \u00fd r\u1eb1ng l\u1ef1a ch\u1ecdn gi\u1eefa &#8220;xtreg&#8221; v\u00e0 &#8220;areg&#8221; ph\u1ee5 thu\u1ed9c v\u00e0o lo\u1ea1i d\u1eef li\u1ec7u c\u1ee7a b\u1ea1n v\u00e0 y\u00eau c\u1ea7u c\u1ee5 th\u1ec3 c\u1ee7a m\u00f4 h\u00ecnh h\u1ed3i quy FE ho\u1eb7c FEM c\u1ee7a b\u1ea1n. N\u00ean xem t\u00e0i li\u1ec7u h\u01b0\u1edbng d\u1eabn c\u1ee7a Stata ho\u1eb7c t\u00ecm hi\u1ec3u th\u00eam v\u1ec1 c\u00fa ph\u00e1p v\u00e0 t\u00f9y ch\u1ecdn cho m\u1ed7i l\u1ec7nh \u0111\u1ec3 s\u1eed d\u1ee5ng \u0111\u00fang c\u00e1ch cho nghi\u00ean c\u1ee9u c\u1ee7a b\u1ea1n.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Lenh_hoi_quy_mo_hinh_REM_trong_stata\"><\/span>L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh REM trong stata<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Trong Stata, \u0111\u1ec3 th\u1ef1c hi\u1ec7n m\u00f4 h\u00ecnh h\u1ed3i quy Random Effects (RE) ho\u1eb7c Random Effects with Time Dummies (REM), b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh &#8220;xtreg&#8221; ho\u1eb7c &#8220;reghdfe&#8221;. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 c\u00fa ph\u00e1p v\u00e0 c\u00e1c t\u00f9y ch\u1ecdn ph\u1ed5 bi\u1ebfn cho m\u1ed7i l\u1ec7nh:<\/p>\n<ol>\n<li>S\u1eed d\u1ee5ng l\u1ec7nh &#8220;xtreg&#8221;:<\/li>\n<\/ol>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\">xtreg dependent_var independent_var1 independent_var2 ..., re<br \/>\n<\/code><\/div>\n<\/div>\n<p>ho\u1eb7c<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\">css<\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-css\">xtreg dependent_var independent_var1 independent_var2 ..., <span class=\"hljs-selector-tag\">i<\/span>(panel_var), re<br \/>\n<\/code><\/div>\n<\/div>\n<p>Trong \u0111\u00f3:<\/p>\n<ul>\n<li>&#8220;dependent_var&#8221; l\u00e0 bi\u1ebfn ph\u1ee5 thu\u1ed9c (outcome variable) m\u00e0 b\u1ea1n mu\u1ed1n d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch.<\/li>\n<li>&#8220;independent_var1, independent_var2, &#8230;&#8221; l\u00e0 c\u00e1c bi\u1ebfn \u0111\u1ed9c l\u1eadp (independent variables) m\u00e0 b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch bi\u1ebfn ph\u1ee5 thu\u1ed9c.<\/li>\n<li>&#8220;re&#8221; l\u00e0 t\u00f9y ch\u1ecdn cho Random Effects, cho bi\u1ebft b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng m\u00f4 h\u00ecnh h\u1ed3i quy v\u1edbi hi\u1ec7u \u1ee9ng ng\u1eabu nhi\u00ean.<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>S\u1eed d\u1ee5ng l\u1ec7nh &#8220;reghdfe&#8221;:<\/li>\n<\/ol>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\">scss<\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-scss\">reghdfe dependent_var independent_var1 independent_var2 ..., <span class=\"hljs-built_in\">absorb<\/span>(panel_var)<br \/>\n<\/code><\/div>\n<\/div>\n<p>Trong \u0111\u00f3:<\/p>\n<ul>\n<li>&#8220;dependent_var&#8221; l\u00e0 bi\u1ebfn ph\u1ee5 thu\u1ed9c (outcome variable) m\u00e0 b\u1ea1n mu\u1ed1n d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch.<\/li>\n<li>&#8220;independent_var1, independent_var2, &#8230;&#8221; l\u00e0 c\u00e1c bi\u1ebfn \u0111\u1ed9c l\u1eadp (independent variables) m\u00e0 b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch bi\u1ebfn ph\u1ee5 thu\u1ed9c.<\/li>\n<li>&#8220;panel_var&#8221; l\u00e0 bi\u1ebfn \u0111\u1ea1i di\u1ec7n cho c\u00e1c \u0111\u1eb7c \u0111i\u1ec3m ng\u1eabu nhi\u00ean (random effects) m\u00e0 b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng trong m\u00f4 h\u00ecnh.<\/li>\n<\/ul>\n<p>V\u00ed d\u1ee5:<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\">xtreg y x1 x2, re<br \/>\n<\/code><\/div>\n<\/div>\n<p>ho\u1eb7c<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\">scss<\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-scss\">reghdfe y x1 x2, <span class=\"hljs-built_in\">absorb<\/span>(panel_var)<br \/>\n<\/code><\/div>\n<\/div>\n<p>L\u01b0u \u00fd r\u1eb1ng l\u1ef1a ch\u1ecdn gi\u1eefa &#8220;xtreg&#8221; v\u00e0 &#8220;reghdfe&#8221; ph\u1ee5 thu\u1ed9c v\u00e0o lo\u1ea1i d\u1eef li\u1ec7u c\u1ee7a b\u1ea1n v\u00e0 y\u00eau c\u1ea7u c\u1ee5 th\u1ec3 c\u1ee7a m\u00f4 h\u00ecnh h\u1ed3i quy RE ho\u1eb7c REM c\u1ee7a b\u1ea1n. N\u00ean xem t\u00e0i li\u1ec7u h\u01b0\u1edbng d\u1eabn c\u1ee7a Stata ho\u1eb7c t\u00ecm hi\u1ec3u th\u00eam v\u1ec1 c\u00fa ph\u00e1p v\u00e0 t\u00f9y ch\u1ecdn cho m\u1ed7i l\u1ec7nh \u0111\u1ec3 s\u1eed d\u1ee5ng \u0111\u00fang c\u00e1ch cho nghi\u00ean c\u1ee9u c\u1ee7a b\u1ea1n.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Lenh_hoi_quy_mo_hinh_Pool-OLS_trong_stata\"><\/span>L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh Pool-OLS trong stata<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Trong Stata, \u0111\u1ec3 th\u1ef1c hi\u1ec7n m\u00f4 h\u00ecnh h\u1ed3i quy Pool-OLS (Pooled Ordinary Least Squares), b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh &#8220;regress&#8221; ho\u1eb7c l\u1ec7nh &#8220;xtreg&#8221; v\u1edbi t\u00f9y ch\u1ecdn &#8220;fe&#8221; b\u1ecb v\u00f4 hi\u1ec7u h\u00f3a. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 c\u00fa ph\u00e1p cho m\u1ed7i l\u1ec7nh:<\/p>\n<ol>\n<li>S\u1eed d\u1ee5ng l\u1ec7nh &#8220;regress&#8221;:<\/li>\n<\/ol>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\">regress dependent_var independent_var1 independent_var2 ...<br \/>\n<\/code><\/div>\n<\/div>\n<p>Trong \u0111\u00f3:<\/p>\n<ul>\n<li>&#8220;dependent_var&#8221; l\u00e0 bi\u1ebfn ph\u1ee5 thu\u1ed9c (outcome variable) m\u00e0 b\u1ea1n mu\u1ed1n d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch.<\/li>\n<li>&#8220;independent_var1, independent_var2, &#8230;&#8221; l\u00e0 c\u00e1c bi\u1ebfn \u0111\u1ed9c l\u1eadp (independent variables) m\u00e0 b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch bi\u1ebfn ph\u1ee5 thu\u1ed9c.<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>S\u1eed d\u1ee5ng l\u1ec7nh &#8220;xtreg&#8221; v\u1edbi t\u00f9y ch\u1ecdn &#8220;fe&#8221; b\u1ecb v\u00f4 hi\u1ec7u h\u00f3a:<\/li>\n<\/ol>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\">css<\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-css\">xtreg dependent_var independent_var1 independent_var2 ..., <span class=\"hljs-selector-tag\">i<\/span>(dummy_var), nofe<br \/>\n<\/code><\/div>\n<\/div>\n<p>Trong \u0111\u00f3:<\/p>\n<ul>\n<li>&#8220;dependent_var&#8221; l\u00e0 bi\u1ebfn ph\u1ee5 thu\u1ed9c (outcome variable) m\u00e0 b\u1ea1n mu\u1ed1n d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch.<\/li>\n<li>&#8220;independent_var1, independent_var2, &#8230;&#8221; l\u00e0 c\u00e1c bi\u1ebfn \u0111\u1ed9c l\u1eadp (independent variables) m\u00e0 b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch bi\u1ebfn ph\u1ee5 thu\u1ed9c.<\/li>\n<li>&#8220;dummy_var&#8221; l\u00e0 bi\u1ebfn gi\u1ea3 (dummy variable) \u0111\u01b0\u1ee3c t\u1ea1o \u0111\u1ec3 th\u1ef1c hi\u1ec7n m\u00f4 h\u00ecnh Pool-OLS.<\/li>\n<li>&#8220;nofe&#8221; l\u00e0 t\u00f9y ch\u1ecdn \u0111\u1ec3 v\u00f4 hi\u1ec7u h\u00f3a hi\u1ec7u \u1ee9ng c\u1ed1 \u0111\u1ecbnh (fixed effects) trong l\u1ec7nh &#8220;xtreg&#8221;.<\/li>\n<\/ul>\n<p>V\u00ed d\u1ee5:<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\">regress y x1 x2<br \/>\n<\/code><\/div>\n<\/div>\n<p>ho\u1eb7c<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\">css<\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-css\">xtreg y x1 x2 <span class=\"hljs-selector-tag\">i<\/span>(year), nofe<br \/>\n<\/code><\/div>\n<\/div>\n<p>L\u01b0u \u00fd r\u1eb1ng m\u00f4 h\u00ecnh Pool-OLS gi\u1ea3 \u0111\u1ecbnh r\u1eb1ng kh\u00f4ng c\u00f3 hi\u1ec7u \u1ee9ng c\u1ed1 \u0111\u1ecbnh (fixed effects) ho\u1eb7c hi\u1ec7u \u1ee9ng ng\u1eabu nhi\u00ean (random effects) \u0111\u01b0\u1ee3c xem x\u00e9t. L\u1ef1a ch\u1ecdn gi\u1eefa &#8220;regress&#8221; v\u00e0 &#8220;xtreg&#8221; ph\u1ee5 thu\u1ed9c v\u00e0o y\u00eau c\u1ea7u c\u1ee5 th\u1ec3 c\u1ee7a m\u00f4 h\u00ecnh h\u1ed3i quy Pool-OLS v\u00e0 d\u1eef li\u1ec7u b\u1ea1n \u0111ang l\u00e0m vi\u1ec7c.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Lenh_hoi_quy_mo_hinh_GLS_trong_stata\"><\/span>L\u1ec7nh h\u1ed3i quy m\u00f4 h\u00ecnh GLS trong stata<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Trong Stata, \u0111\u1ec3 th\u1ef1c hi\u1ec7n m\u00f4 h\u00ecnh h\u1ed3i quy GLS (Generalized Least Squares), b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh &#8220;regress&#8221; v\u1edbi t\u00f9y ch\u1ecdn &#8220;robust&#8221; ho\u1eb7c s\u1eed d\u1ee5ng l\u1ec7nh &#8220;xtreg&#8221; v\u1edbi t\u00f9y ch\u1ecdn &#8220;re&#8221; v\u00e0 &#8220;vce(robust)&#8221;. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 c\u00fa ph\u00e1p cho m\u1ed7i l\u1ec7nh:<\/p>\n<ol>\n<li>S\u1eed d\u1ee5ng l\u1ec7nh &#8220;regress&#8221; v\u1edbi t\u00f9y ch\u1ecdn &#8220;robust&#8221;:<\/li>\n<\/ol>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\">regress dependent_var independent_var1 independent_var2 ..., robust<br \/>\n<\/code><\/div>\n<\/div>\n<p>Trong \u0111\u00f3:<\/p>\n<ul>\n<li>&#8220;dependent_var&#8221; l\u00e0 bi\u1ebfn ph\u1ee5 thu\u1ed9c (outcome variable) m\u00e0 b\u1ea1n mu\u1ed1n d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch.<\/li>\n<li>&#8220;independent_var1, independent_var2, &#8230;&#8221; l\u00e0 c\u00e1c bi\u1ebfn \u0111\u1ed9c l\u1eadp (independent variables) m\u00e0 b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch bi\u1ebfn ph\u1ee5 thu\u1ed9c.<\/li>\n<li>&#8220;robust&#8221; l\u00e0 t\u00f9y ch\u1ecdn \u0111\u1ec3 t\u00ednh to\u00e1n c\u00e1c \u01b0\u1edbc l\u01b0\u1ee3ng h\u1ed3i quy robust, \u0111i\u1ec1u ch\u1ec9nh cho sai s\u1ed1 kh\u00f4ng \u0111\u1ed3ng nh\u1ea5t v\u00e0 vi ph\u1ea1m gi\u1ea3 \u0111\u1ecbnh v\u1ec1 ph\u01b0\u01a1ng sai.<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>S\u1eed d\u1ee5ng l\u1ec7nh &#8220;xtreg&#8221; v\u1edbi t\u00f9y ch\u1ecdn &#8220;re&#8221; v\u00e0 &#8220;vce(robust)&#8221;:<\/li>\n<\/ol>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\">scss<\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-scss\">xtreg dependent_var independent_var1 independent_var2 ..., re <span class=\"hljs-built_in\">vce<\/span>(robust)<br \/>\n<\/code><\/div>\n<\/div>\n<p>Trong \u0111\u00f3:<\/p>\n<ul>\n<li>&#8220;dependent_var&#8221; l\u00e0 bi\u1ebfn ph\u1ee5 thu\u1ed9c (outcome variable) m\u00e0 b\u1ea1n mu\u1ed1n d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch.<\/li>\n<li>&#8220;independent_var1, independent_var2, &#8230;&#8221; l\u00e0 c\u00e1c bi\u1ebfn \u0111\u1ed9c l\u1eadp (independent variables) m\u00e0 b\u1ea1n mu\u1ed1n s\u1eed d\u1ee5ng \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n ho\u1eb7c gi\u1ea3i th\u00edch bi\u1ebfn ph\u1ee5 thu\u1ed9c.<\/li>\n<li>&#8220;re&#8221; l\u00e0 t\u00f9y ch\u1ecdn \u0111\u1ec3 s\u1eed d\u1ee5ng m\u00f4 h\u00ecnh h\u1ed3i quy v\u1edbi hi\u1ec7u \u1ee9ng ng\u1eabu nhi\u00ean (random effects).<\/li>\n<li>&#8220;vce(robust)&#8221; l\u00e0 t\u00f9y ch\u1ecdn \u0111\u1ec3 t\u00ednh to\u00e1n c\u00e1c \u01b0\u1edbc l\u01b0\u1ee3ng h\u1ed3i quy robust.<\/li>\n<\/ul>\n<p>V\u00ed d\u1ee5:<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\">regress y x1 x2 ..., robust<br \/>\n<\/code><\/div>\n<\/div>\n<p>ho\u1eb7c<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\">scss<\/div>\n<\/div>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-scss\">xtreg y x1 x2 ..., re <span class=\"hljs-built_in\">vce<\/span>(robust)<br \/>\n<\/code><\/div>\n<\/div>\n<p>L\u01b0u \u00fd r\u1eb1ng m\u00f4 h\u00ecnh GLS cho ph\u00e9p b\u1ea1n \u0111i\u1ec1u ch\u1ec9nh cho sai s\u1ed1 kh\u00f4ng \u0111\u1ed3ng nh\u1ea5t v\u00e0 vi ph\u1ea1m gi\u1ea3 \u0111\u1ecbnh v\u1ec1 ph\u01b0\u01a1ng sai. L\u1ef1a ch\u1ecdn gi\u1eefa &#8220;regress&#8221; v\u00e0 &#8220;xtreg&#8221; ph\u1ee5 thu\u1ed9c v\u00e0o y\u00eau c\u1ea7u c\u1ee5 th\u1ec3 c\u1ee7a m\u00f4 h\u00ecnh GLS v\u00e0 d\u1eef li\u1ec7u b\u1ea1n \u0111ang l\u00e0m vi\u1ec7c.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C\u00e1c l\u1ec7nh h\u1ed3i quy d\u1eef li\u1ec7u b\u1ea3ng trong stata Trong Stata, \u0111\u1ec3 th\u1ef1c hi\u1ec7n h\u1ed3i quy d\u1eef li\u1ec7u b\u1ea3ng, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh &#8220;regress&#8221;. D\u01b0\u1edbi&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,7],"tags":[8],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-phan-mem","category-su-dung-phan-mem","tag-stata"],"_links":{"self":[{"href":"https:\/\/ungdung.hotronghiencuu.com\/open\/wp-json\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ungdung.hotronghiencuu.com\/open\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ungdung.hotronghiencuu.com\/open\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ungdung.hotronghiencuu.com\/open\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ungdung.hotronghiencuu.com\/open\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":3,"href":"https:\/\/ungdung.hotronghiencuu.com\/open\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":88,"href":"https:\/\/ungdung.hotronghiencuu.com\/open\/wp-json\/wp\/v2\/posts\/85\/revisions\/88"}],"wp:attachment":[{"href":"https:\/\/ungdung.hotronghiencuu.com\/open\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ungdung.hotronghiencuu.com\/open\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ungdung.hotronghiencuu.com\/open\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}