{"id":1428,"date":"2019-08-13T15:21:21","date_gmt":"2019-08-13T19:21:21","guid":{"rendered":"http:\/\/kaichen.work\/?p=1428"},"modified":"2025-08-18T17:20:01","modified_gmt":"2025-08-18T21:20:01","slug":"stata-command-to-perform-chow-test","status":"publish","type":"post","link":"https:\/\/www.kaichen.work\/?p=1428","title":{"rendered":"Misusing the Chow Test: What You\u2019re Really Testing"},"content":{"rendered":"<p>A Chow test is used to check for a structural change between two regressions:<\/p>\n<ul>\n<li class=\"p1\">The null hypothesis H0 is that all coefficients in the two regressions are the same.<\/li>\n<li class=\"p1\">The alternative hypothesis <span class=\"s1\">H1<\/span>\u00a0is that <span class=\"s2\"><b>at least one<\/b><\/span> of the coefficients is different.<\/li>\n<\/ul>\n<p>The standard Chow test is joint, checking all coefficients together. However, more often we care about whether an individual coefficient is equal across two groups. If that&#8217;s our purpose, we wouldn&#8217;t really use the standard Chow test, or state in our work that &#8220;we use the Chow test to check the equality of the coefficient on X across the two subsamples&#8221;.<\/p>\n<p>In this post, I first show how to perform the standard Chow test. Then I show how to perform a test checking if an individual coefficient is equal across two groups.<\/p>\n<p><strong>Perform the standard Chow test<\/strong><\/p>\n<p>Assume that we have two groups of observations. We have stacked (combined vertically) the two groups and generated a variable <code>group<\/code>, which takes the value of either 1 or 2, to indicate if an observation belongs to either group 1 or 2.<\/p>\n<p>We perform the following regressions on the two groups separately:<\/p>\n<p>y = a1 + b1*x1 + c1*x2 + u \u00a0 \u00a0 \u00a0 \u00a0for group == 1<br \/>\ny = a2 + b2*x1 + c2*x2 + u \u00a0 \u00a0 \u00a0 \u00a0for group == 2<\/p>\n<p>It&#8217;s important to note that the standard Chow test is used to test whether the assertion <b>a1==a2<\/b>, <b>b1==b2<\/b>, and <b>c1==c2<\/b> holds true jointly; it cannot be used to test whether any single one of them holds true.<\/p>\n<p>The commands for the standard Chow test are listed below:<\/p>\n<p><code>ge g2=(group==2)<\/code><br \/>\n<code>regress y c.x1##i.g2 c.x2##i.g2<\/code><br \/>\n<code>test 1.g2 1.g2#c.x1 1.g2#c.x2<\/code><\/p>\n<p>The last command is equivalent to:<\/p>\n<p><code>contrast g2 g2#c.x1 g2#c.x2, overall<\/code><\/p>\n<p><a href=\"https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/standard_chow_test-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2263\" src=\"https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/standard_chow_test-1.png\" alt=\"\" width=\"1270\" height=\"2064\" srcset=\"https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/standard_chow_test-1.png 1270w, https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/standard_chow_test-1-185x300.png 185w, https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/standard_chow_test-1-630x1024.png 630w, https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/standard_chow_test-1-768x1248.png 768w, https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/standard_chow_test-1-945x1536.png 945w, https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/standard_chow_test-1-1260x2048.png 1260w\" sizes=\"(max-width: 1270px) 100vw, 1270px\" \/><\/a><\/p>\n<p>The <code>test<\/code> command and the <code>contrast<\/code> command (see the line of &#8220;Overall&#8221;) report the same results. Please note: (1) the F-stat for each independent variable is the square of the corresponding t-stat reported in the regression result table; (2) unlike the z- and t-distributions, the F-distribution is strictly nonnegative and has only a right-tail rejection region. In other words, the F-test is equivalent to a <span class=\"s1\">two-sided t-test<\/span> and cannot be transformed to a one-tailed test.<\/p>\n<p><strong>Test the equality of individual coefficients<\/strong><\/p>\n<p>More commonly, we&#8217;d like to test whether a1 == a2 across the two groups (or b1 == b2). If the equality of an individual coefficient is our main interest, we should set up a pooled regression with the group indicator interacting with every independent variable.<\/p>\n<p>Fortunately, under the hood of the standard Chow test is the pooled regression we have to resort to. We only need to check the regression result table presented above:<\/p>\n<ul>\n<li>If we want to test if a1 == b1, then check the t-stat on <code>1.g2#c.x1<\/code><\/li>\n<li>If we want to test if b1 == b2, then check the t-stat on <code>1.g2#c.x2<\/code><\/li>\n<\/ul>\n<p>Both one-tailed (if the null hypothesis is directional, such as a1 &lt;= a2) and two-tailed (if the null hypothesis is non-directional, such as a1 == a2) tests are possible.<\/p>\n<p>Another option to perform the test is to use the following commands:<\/p>\n<p><code>regress y x1 x2 if group==1<\/code><br \/>\n<code>est store coefa<\/code><br \/>\n<code>regress y x1 x2 if group==2<\/code><br \/>\n<code>est store coefb<\/code><br \/>\n<code>suest coefa coefb<\/code><br \/>\n<code>lincom [coefa_mean]x1-[coefb_mean]x1<\/code><\/p>\n<p><a href=\"https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/althernative_to_pooled_regression.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2265\" src=\"https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/althernative_to_pooled_regression.png\" alt=\"\" width=\"1112\" height=\"2166\" srcset=\"https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/althernative_to_pooled_regression.png 1112w, https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/althernative_to_pooled_regression-154x300.png 154w, https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/althernative_to_pooled_regression-526x1024.png 526w, https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/althernative_to_pooled_regression-768x1496.png 768w, https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/althernative_to_pooled_regression-789x1536.png 789w, https:\/\/www.kaichen.work\/wp-content\/uploads\/2025\/08\/althernative_to_pooled_regression-1051x2048.png 1051w\" sizes=\"(max-width: 1112px) 100vw, 1112px\" \/><\/a><\/p>\n<p>The benefit of this set of commands is that the difference in coefficients is reported directly, and the z-stat allows a one-tailed test as well.<\/p>\n<p>I benefit from the two useful articles from Stata&#8217;s official website:<\/p>\n<p><a href=\"https:\/\/www.stata.com\/support\/faqs\/statistics\/chow-tests\/\" target=\"_blank\" rel=\"noopener noreferrer\">Can you explain Chow tests?<\/a><br \/>\n<a href=\"https:\/\/www.stata.com\/support\/faqs\/statistics\/computing-chow-statistic\/\" target=\"_blank\" rel=\"noopener noreferrer\">How can I compute the Chow test statistic?<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Chow test is used to check for a structural change between two regressions: The null hypothesis H0 is that all coefficients in the two regressions are the same. The alternative hypothesis H1\u00a0is that at least one of the coefficients &hellip; <a href=\"https:\/\/www.kaichen.work\/?p=1428\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts\/1428"}],"collection":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1428"}],"version-history":[{"count":17,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts\/1428\/revisions"}],"predecessor-version":[{"id":2269,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts\/1428\/revisions\/2269"}],"wp:attachment":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}