Economics, econometrics, etc. Wed, 06 Jul 2016 20:47:17 +0000 en-US hourly 1 The Guardian and undergraduate economics Tue, 26 Nov 2013 01:26:12 +0000 The Guardian newspaper has issued a series of articles about academic economics in the past few weeks. They include Mainstream economics is in denial: the world has changed, Economics students need to be taught more than neoclassical theory, and Orthodox economists have failed their own market test. I limit comments here to that last piece, by Seumas Milne, as Mr. Milne seems most intent on pegging the economics critic crankometer, but Mr. Milne’s themes are repeated in the other articles.

But, Milne’s claim that economics students should be exposed to multiple modes of thinking about economics seems uncontroversial. He echoes, for example, the National Council for Excellence in Critical Thinking’s (NCECT) advice that

Students successfully completing a [course] in scientific foundations will demonstrate a range of scientific thinking skills and and abilities which they use in the acquisition of knowledge… [including the ability] to identify relevant competing scientific points of view.



The Guardian complains that instructors are required to teach that only majority opinions constitute “the” scientific perspective. However, this claim only serves to confuse the scientific and curricular issues further. First of all, many scientific ideas are not presented at the undergraduate level at all, despite being majority opinions. More important, scientific theories and models do not take their place in either the research or the education communities because they have the “right” to be represented. Minority views in the sciences must earn their place by successful demonstration and usefulness in addressing key research issues in the discipline; these are the criteria by which they are accepted. In contrast, outsiders are likely to be persuaded not by the scientific evidence (which may be too specialized or complex for them to understand completely) but by the arguments based on our cultural value of fairness and equality–a perspective derived from the First Amendment and other “civil rights.”

In conclusion, the locus of the controversy the Guardian inflames is within the public domain. It is perhaps most remarkable that the “controversy” over teaching economics has not changed its character, even as economic theory has discovered and incorporated many phenomena previously “undreamt of in [our] philosophy.” Indeed, even as the scientific community accepts new ideas and models that strengthen and invigorate mainstream theory, critics of mainstream economics continue to argue that these same models weaken the scientific position of mainstream economics.

Small addendum.

I should probably note that all of the above text beginning “What is wrong with the notion…” is very lightly edited quotes from the essay “Why Teach Evolution?” by biologists Andrew Petto and Laurie Godfrey in the collection Scientists Confront Creationism. I changed “evolutionary theory” to “mainstream theory,” “Neo-Darwinian” to “neoclassical,” “we” to “I,” and “the Discovery Institute” to “the Guardian.” The gist of the article is that creationists commonly attack introductory biology textbooks on highly questionable and ideologically-motivated grounds, pounce on errors or outdated information in such textbooks, and demand that the obscure and/or scientifically invalid theories which conform to their religious ideology be taught along with mainstream biology.




The good news is that if the writers at the Guardian would put down their pitchforks and pay attention to what’s going on in mainstream economics, they’d find that economics is not the enemy of progressive political opinions—the “neoclassical” modeling approach of optimization plus equilibrium is routinely used by everyone from Analytical Marxists to evolutionary biologists; exploiting this extremely useful modeling strategy does not imply any particular political position. It cannot be emphasized enough that the Guardian’s overarching premise that “neoclassical,” “orthodox,” “mainstream,” “neoliberal,” and “free market” all mean the same thing when used before the word “economics” is utter nonsense.

Undergraduate textbooks are, contrary to the Guardian’s claims, full of models in which the market fails and the situation can be improved by policy interventions, including but not limited to models in which asymmetric information leads to market failure. Mainstream economics is not “free market economics,” as anyone can verify simply by opening an economics 101 textbook, or certainly by taking more advanced but still undergraduate courses in, well, any field, but notably environmental, health, development, labour, behavioral, or public economics. Or, for that matter, econometrics, since most economic research is empirical and econometric theory is kind of hard to place on the political spectrum.

What would Mr. Milne and his colleagues find if they were to actually read some of the mainstream literature, even as presented in undergraduate textbooks? They’d find that economists actually spend a lot of time discussing issue they allege we ignore. For example, how do we know that income inequality has become worse in many countries over the past several decades? We know that because mainstream economists found and reported that result in mainstream journals using mainstream methods (there would be no “Occupy” movement without mainstream economists). There are hundreds of papers published in mainstream journals every year measuring inequality, attempting to empirically and theoretically explore its causes, and attempting to estimate its consequences in terms of well-being in a number of dimensions, including but not limited to mental and physical health.

Milne’s claim that economics has little to say about financial crises is similarly ill-informed—mainstream journals are full of papers studying the causes and consequences of the crisis, and many more will appear as more data become available. One cannot reasonably argue that economists have little or nothing to say about financial crises, but one could reasonably argue that economists didn’t do enough research on financial instability prior to the crisis, but in order to make such an assessment one would have to have actually read the literature, rather than ignorantly and uncharitably concluding that, for example, Ben Bernanke assumed away the possibility of a crisis.

Undergraduate economics training could use an overhaul, but doing so in the manner suggested by the Guardian would be an enormous step backwards.

]]> 4
Inequality, poverty, and health: Comments on the Globe’s coverage Tue, 12 Nov 2013 21:21:14 +0000 Canada’s Globe and Mail newspaper has been running a series of articles on income inequality. This post presents some comments on the coverage of income inequality and health in Wealth begets health: Why universal medical care only goes so far by André Picard.


Income inequality vs poverty as a cause of poor health.

The article conflates two issues which are conceptually distinct and have different policy implications: the effect of poverty on health, and the effect of income inequality on health. The evidence suggests that poverty reduces health, but there is little solid evidence, and much skepticism in the literature, over the idea that inequality per se leads to lower health, and even more skepticism over the notion that any effect of inequality on health occurs through “stress.” In a previous, fairly technical, blog post I presented an overview of some of the empirical literature on inequality and health. The very short version is: there is pretty good evidence that an individual’s income causes her health, but this effect is much stronger at low levels of income (as in the figure below). There is no good evidence that, holding an individual’s income constant, increases in income inequality decrease that individual’s health. And finally, a variety of factors, notably education and health in childhood, cause both adult income and adult health.

Correlation, causation, and all that.

Pointing out that correlation does not imply causation is tiresome, but here this issue is important as much of the article consists of listing correlations between income and health and interpreting those correlations as if they are evidence of causation from income to health:

Virtually every measure of population health – from child mortality to rates of cancer, cardiovascular disease and traumatic injury – is worse in poor areas than in wealthier ones.

Canadians with an income of $15,000 or less have three times the risk of developing diabetes than those who earn more than $80,000.

Similarly, the risk of dying of cancer within five years of diagnosis is 47 per cent higher in the low-income group than the high-income one.

People living in poor neighbourhoods have a 37 per cent greater risk of suffering a heart attack than those in wealthier areas. But those in middle-income neighbourhoods have a 21 per cent great risk than residents of the richest areas. Most health problems follow a similar gradient.

Consider that, compared with the highest income group, in the lowest income group the rate of stillbirths is 24 per cent higher, the infant mortality rate is 58 per cent higher and cases of sudden infant death syndrome are 83 per cent higher.

Children born to low-income parents are twice as likely to end up in special education classes and three times as likely to suffer mental health problems than those in the highest income group.

Statistics Canada found, for example, that at age 25, life expectancy varies between the highest and lowest income groups by 7.1 years for men and 4.9 years for women.

Some of the best-known research on inequality was done by Sir Michael Marmot, a professor at University College in London. He tracked civil servants in the U.K. and found that mortality rates correlated perfectly with social status and income – in other words, the lowest paid died much younger.

These correlations don’t tell us anything about the effect of income on health, as we would observe such correlations even if there is no causal effect of income on health.

To see why, suppose that income does not cause health for anyone, but also, along with the literature, that education does health. If we were to arrange people in a line from lowest income to highest income, as we move up the line we will tend to find healthier people, but we’d also find that people farther along in the line tend to have more education. We might find all the correlations listed in the article, including correlations between mother’s income and infant’s health, even though we started by assuming that income does not cause health. In the real world, it is likely that there is some effect of adult income on adult health, but we also know that education and a wide variety of other characteristics affect both health and income. That result prevents us from interpreting the finding that higher income and better health are linked as evidence that income causes health.

Some research attempts to statistically control for as many of these influences as possible, but researchers face an additional difficulty: health causes income. Again suppose for the sake of argument that there is no effect of income on health, but also that healthier people tend to fare better in the labor market. If we look across people or across regions, we’ll again find that people with higher incomes tend to be healthier, but we again started with the assumption that income does not cause health.

Some earlier findings purporting to find evidence of effects of income on health are now thought to reflect either “reverse” causation from health to income, or difficult to measure “third variables” which cause both health and income. In addition to education, another particularly important such variable is childhood health, which has been shown to largely explain the correlation between income and adult health in the work by Michael Marmot cited by Mr. Picard (Case and Paxson 2011).

Much of the literature suggests that changes in income have little effect on health, at least for employed adults. Longitudinal studies tracking people over time show that high health predicts which workers will receive promotions, but getting a promotion does not seem to have any effect on a worker’s health, implying that health causes income but not the other way around. Further, comparing two workers with the same initial health, the worker whose income goes up faster is not less likely to die than than his lower-paid counterpart, and there is little evidence that “stress” due to relatively low income is the primary mechanism through which any effect of adult income on health operates (Gardner and Oswald 2004, Adams, Hurd, McFadden, Merrill, and Ribeiro 2003, Jones and Wildman 2008).

Poverty and health care costs.

Finally, putting aside the complex relationship between income and health, consider the claim that income inequality causes higher health care expenditures,

One study estimates that if those in the bottom 20 per cent of income earned as much as those one step higher on the income ladder, the savings to the health system would be $7.6-billion a year.

The source for this figure appears to be this report from the Ontario Association of Food Banks. The author takes cross-sectional data on health expenditures by income quintile and estimates that these expenditures are $7.6B higher in the lowest quintile than in the second-lowest quintile. But there are two serious problems with the interpretation in the Globe article. First, the article interprets this correlation as entirely causal, and as we have seen, that interpretation is consistent with neither theory nor evidence. Second, making people healthier does not necessarily decrease long-run demand on the health care system—in fact, increasing a person’s health may wind up increasing that person’s demand on the system, as they are more likely to live longer and consume health care resources through old age. This isn’t necessarily the case–possibly policies which decrease poverty would have the net effect of decreasing long-run demand on the health care system–but we’d need much more evidence to draw that conclusion.

The point that better health may have little or a counter-intuitively positive effect on health care spending should not be interpreted as an argument against policies which reduce poverty—we value health in and of itself, not solely or even largely because of its impact on health care spending. But we we ought not offer the enticement of fiscal savings though changes in demand on the publicly-funded health care system as a major reason to enact such anti-poverty measures.

Policy implications.

We have seen that the issues surrounding income, income inequality, and health are tricky and the subject of much ongoing research. If we should not conclude that income inequality per se is the main culprit nor that policies which affect incomes are likely to have large effects on health care expenditures, what policy implications should we draw from this research?

We know that public policies affecting income can improve the long-run health of children. Simply increasing the incomes of families in poverty can improve children’s health, for example, Hoynes, Miller, and Simon (2012) show that increased generosity of the U.S. EITC (essentially a negative income tax) improved infant health outcomes, which are likely to play out as better outcomes in many dimensions over those infants’ entire lives.

More generally, there is evidence that poverty causes low health. There is evidence that childhood deprivation harms children, and also that harm done to children’s well-being continues to affect those children throughout their lives. And there is evidence that sound public policy interventions can be effective in reducing such problems, including well-targeted income redistribution but also, and perhaps more importantly, improved quality and quantity of education.

]]> 5
U.S. voters more likely to support marijuana legalization than non-voters Mon, 04 Nov 2013 19:29:26 +0000 Much has been made of a recent Gallup poll showing a majority of Americans now support marijuana legalization. But if a majority support legalization, why do politicians seem so reluctant to support drug law reform?

One explanation for this puzzle is that Americans who vote are less likely to support legalization than those who do not vote. Voters tend to be older, and possibly have other characteristics which are associated with opposition to drug policy reform.

The Gallup poll result is consistent with, but shows somewhat more support than, recent results from the General Social Survey (GSS), which suggest that roughly half of Americans supported legalization in 2011 and 2012. Unlike the Gallup polls, the GSS data are available to researchers, and include a wide variety of information on respondents, including whether or not they voted in the most recent Presidential election.

I set out to show using all GSS waves between 1975 and 2012 which include the legalization support question (n=26,870) that people who vote are less likely to support legalization than people who do not vote, which would help explain why politicians seem out of sync with public sentiment.

But I found the opposite.


The graph shows support for legalization for all respondents, for respondents who voted in the last Presidential election, and for respondents who did not vote in the last election. Up until about a decade ago, voters tended to be moderately less likely to support legalization than non-voters. But since 2004 voters have been modestly more likely to support legalization than non-voters. Restricting attention to post 2004 sample waves, voters are 3.8 percentage points more likely support than non-voters (z=2.61).

So the puzzle is not resolved by differences in attitudes towards legalization across voters and non-voters.

Correlates of support for legalization.

I also ran a few regressions to check if what we see in the graph goes away with a few basic controls (notably age), and how support varies with demographic characteristics. The table below shows results from regression models in which the dependent variable is a dummy indicating support for legalization. Each cell contains the estimated parameter with the associated t-ratio below. The covariate of interest is “voted last elec.”, a dummy indicating the respondent voted in the preceding Presidential election. (All estimates are marginal effects from probit regressions with robust standard errors.)

The first column shows that, over the entire sample from 1975 through 2012, voting in the last election is associated with about three percentage points lower support for legalization (z=4.59). The second column adds complete sets of age and year dummies, which are enough to flip the sign on the voter dummy. Holding age constant and removing any common trend over time in voting propensities and support for legalization, U.S. voters are slightly more likely to support legalization than non-voters (by 1.4 percentage points, z=2.49). The results on the age effects (unreported) suggest that all else equal older cohorts are less likely to support than younger cohorts, providing some sketchy evidence in favor of the notion that support will increase over time as older cohorts, er, shrug this mortal coil.

The model presented in the last column adds controls for religion, education, political leanings, and region, which does essentially nothing to the estimated association between voting and support for legalization.

The results also show that religious belief and behavior are strong predictors of support: non-religious people are substantially more likely to support legalization than otherwise identical non-religious people (by about 17 percentage points, z=13.71), observant religious people are much less likely to support than religious but non-observant people (by about 14 percentage points, z=14.15).

The omitted education category is high school dropouts. More education strongly predicts higher support for legalization, other things equal.

Finally, holding all else equal, people with moderate political leanings (the omitted category) are more likely to support than conservatives (by about 6 percentage points, z=7.85) and less likely to support than liberals (by about 11 percentage points, z=13.68).

Model 1 Model 2 Model 3
voted last elec. -0.027 0.014 0.014
-4.59 2.49 2.36
Catholic 0.016
No religion 0.168
Other religion 0.096
Observant -0.140
high school 0.042
junior college 0.070
bachelor 0.075
graduate 0.109
conservative -0.058
liberal 0.114
middle atlantic -0.035
e. nor. central -0.033
w. nor. central -0.058
south atlantic -0.046
e. sou. central -0.046
w. sou. central -0.055
mountain -0.018
pacific 0.017
age dummies no yes yes
year dummies no yes yes
n 26,870 26,870 26,870
]]> 0
What do economists do? PhD job openings 2009-2013. Tue, 29 Oct 2013 23:25:05 +0000 This post breaks down academic job openings for economists over the last five years by field. As reflected by job openings, what do economists study, and which fields have been “hot” over this time window?

My motivation for digging into these data is in part the response to my list of 18 symptoms of bad economics criticism. Paul Krugman and John Quiggin claimed that macro actually does dominate economics, although it’s not clear either of them actually disagrees with symptom #1 of bad criticism—the notion that economics as discipline is useless if we can’t forecast future states of the macroeconomy.

It was not my intention to start an interdisciplinary pissing match—macro is indeed a very important field, arguably the most important field in terms of policy relevance. But macro is just one field among many. Reflecting on the relative importance of macroeconomics made me wonder what proportion of economists are macroeconomists. And for that matter, how does the rest of the discipline break down by field? I have strong anecdotal impressions, but I don’t recall ever seeing statistics from representative data.

The market for economics PhDs is centralized. Almost all job openings are advertised in Job Openings for Economists, put out by the American Economic Association. The following results are based on the last five October issues, focusing on the desired fields (by standardized JEL codes) specified in the advertisement. (Employers often specify multiple fields in one ad, which I have handled by weighting such ads by the reciprocal of the number of fields listed. For example, an ad which lists the three fields Public, Labor, and Health is treated as 1/3 of a Public ad, 1/3 of a Labor ad, and 1/3 of a Health ad.)

Only a small proportion of jobs are in macro.

Macro is smaller than I would have guessed. The proportion of job openings for macroeconomists is small, as illustrated in the graph below. joe-graph0 Macro only forms about 10% of the market. This estimate may be attenuated somewhat because of the overlap between macro and other fields (notably International), but that issue cuts both ways.

Job openings by field.

As shown in the graph below, International is the most demanded field followed by Micro, “Mathematics and quantitative methods” (largely theoretical econometrics) and Macro. Moving down the list, we find a bunch of fields clustered together at about 50 openings give or take a dozen: Macro, Finance, Industrial Organization, Agricultural, Labor, Public, Development, and HEW (Health, Education, and Welfare, which is largely Health). Then remaining fields are small, added together they are comparable to one of the larger fields: “General,” Urban, Business Economics, Law and Economics, Economic History, History of Thought (which includes heterodox economics), and some miscellaneous fields with a just one or two jobs over the last five years.

Short term trends.

PhD candidates will be happy to learn that the number of job openings has risen rapidly over the last five years, from about 200 to almost 350. Which fields are hot?
The graph shows number of openings by field in 2009 and an arrow pointing to the number of jobs in the same field in 2013. International, Agricultural, Development, Labor, Public, and HEW experienced substantial increases in openings, whereas openings in Micro fall modestly and most other fields are fairly stable.

Some simple regression analysis largely confirms what we see in the graph. For each field, I regressed job openings on a linear trend. Along with openings per year and total openings, the estimated trend (\(\hat\beta\)) and the associated p-value against the null that there is no trend are displayed in the table below (these are regressions with n=5 and the p-values are based on OLS standard errors, so take with whatever size grain of salt you view as appropriate). Labor, Public, Finance, Agricultural, and International have expanded fastest, and all of these increases are statistically significant.

My code is a mess so I won’t post a link here, but email me if you would like me to send you a copy to play with.

Edit: Fixed an error with the second graph, updated descriptive text in preceding paragraph. October 30, 2013.

Field 2009 2010 2011 2012 2013 total \(\hat\beta\) p-value
International 12.4 14.7 17.6 16.8 18.7 80.1 1.5 0.02
Micro 13.0 14.3 10.9 15.9 9.5 63.6 -0.5 0.60
Quant/math 8.8 13.0 12.4 13.3 12.2 59.7 0.7 0.27
Macro 9.4 15.3 7.7 13.8 10.2 56.4 -0.0 0.99
AgEcon 7.2 10.3 10.2 14.0 14.2 55.9 1.8 0.01
Development 6.6 9.8 10.9 11.1 13.3 51.7 1.5 0.01
IO 8.0 8.4 7.5 8.5 11.2 43.6 0.7 0.17
Public 5.3 7.9 8.1 10.7 10.3 42.4 1.3 0.02
Health Ed Wfare 5.0 7.4 7.7 12.0 9.4 41.4 1.3 0.09
Finance 6.1 7.8 7.7 8.3 10.1 40.0 0.9 0.02
Labor 4.6 7.0 6.6 8.6 12.1 39.0 1.7 0.02
General 3.4 6.1 5.6 7.4 2.5 25.0 -0.1 0.95
All/default 5.5 3.5 5.8 3.7 3.3 21.8 -0.4 0.33
Business 3.0 2.3 3.3 1.9 4.7 15.1 0.3 0.46
Urban 2.6 2.3 2.8 3.7 3.4 14.8 0.3 0.09
History 2.1 1.5 2.0 1.9 2.5 10.0 0.1 0.36
Law 0.8 1.8 2.5 2.5 2.3 10.0 0.4 0.10
Hist thought 1.0 1.6 1.9 1.7 2.0 8.2 0.2 0.09
special 0.8 0.6 1.0 0.5 0.7 3.6 -0.0 0.70
systems 1.3 0.3 0.1 0.4 1.0 3.2 -0.0 0.82
misc 0.1 0.5 0.7 1.3 0.2 0.25
]]> 8
18 signs you’re reading bad criticism of economics Wed, 23 Oct 2013 20:40:22 +0000 Every mainstream science which touches on political or religious ideology attracts more than its fair share of deniers: the anti-vaccine crowd v mainstream medicine, GMO fearmongers v geneticists, creationists v biologists, global warming deniers v climatologists. Economics is no different, but economics cranks differ in that they typically make false claims about the content of economics itself, as opposed, or as a prelude, to false claims about the way the world works. That target sometimes making it hard for non-economists to differentiate crankery from solid criticism.
Here, then, are some symptoms of bad critiques of economics:

  1. Treats macroeconomic forecasting as the major or only goal of economic analysis.
  2. Frames critique in terms of politics, most commonly the claim that economists are market fundamentalists.
  3. Uses “neoclassical” as if it refers to a political philosophy, set of policy prescriptions, or actual economies. Bonus: spells it “neo-classical” or “Neo-classical.”
  4. Refers to “the” neoclassical model or otherwise suggests all of economic thought is contained in Walras (1874).
  5. Uses “neoclassical economics” and “mainstream economics” interchangeably. Bonus: uses “neoliberal economics” interchangeably with either.
  6. Uses the word “neoliberal” for any reason.
  7. Refers to “corporate masters” or otherwise implies economists are shills for the wealthy or corporations.
  8. Claims economists think people are always rational.
  9. Claims financial crisis disproved mainstream economics.
  10. Explicitly claims that economics is not empirical, or does so implicitly by ignoring empirical economics.
  11. Treats all of economics as if it’s battling schools of macroeconomics.
  12. Misconstrues jargon: “rational.”
  13. Misconstrues jargon: “efficient” (financial sense) or “efficient” (Pareto sense).
  14. Misconstrues jargon: “externality“.
  15. Claims economists only care about money.
  16. Claims economists ignore the environment. Variant: claims economics falters on point that “infinite growth on a finite planet is impossible.”
  17. Goes out of its way to point out that the Economics Nobel is not a real Nobel.
  18. Cites Debunking Economics.
    ]]> 217 GMM and its application outside finance Mon, 21 Oct 2013 19:55:38 +0000 The 2013 Nobel prize in economics was won by Fama, Shiller, and some other dude, according to most media accounts. Fama and Shiller were pretty easy to explain: one of them is at Chicago and is associated with a theory called “efficient markets,” so he’s the free market guy. Shiller criticized the Chicago guy, so we know where to put him on the political spectrum. But this third guy, Hansen, well, he’s at Chicago, but he does some sort of theoretical econometrics, so if we’re the Guardian we’ll just assume he’s “ultra-conservative” and then ignore him, or if we’re anyone else we’ll skip to just ignoring him (even the Economist gives up, complaining they can’t explain his work without “writing all sorts of equations in our newspaper.”) This post attempts to provide a relatively gentle, albeit with all sorts of equations, introduction to part of the third guys’s research, focusing on applications in causal modeling in microeconomics rather than the examples from finance or macroeconomics.

    There are some good discussions of Hansen’s most influential contribution, the Generalized Method of Moments (GMM) in the economic blogsphere, examples include Guan Yang, John Cochrane, and Jeff Leek. This post presents another, which differs mostly in that the discussion does not focus on applications in asset pricing. The basic ideas in Hansen (1982) are elaborations and generalizations of ideas presented in Sargan (1958), which develops overidentified instrumental variables estimators in a modern context, a method mostly used to infer causal effects from observational data.

    GMM in a very simple problem.

    Suppose we have a sample on some variable \(y\) of size \(n\) and we would like to estimate the mean of \(y\) denoted \(\mu=E(y)\). In this simple case, the method of moments tells us to estimate \(\mu\) by replacing the population condition

    $$ E[ y – \mu ] = 0 $$

    with its sample analog,

    $$ \frac{1}{n}\sum_i [ y_i – \hat\mu ] = 0, $$

    where our estimator \(\hat\mu\) is the value of the parameter \(\mu\) which makes the equation above true. The method of moments estimator of \(\mu\) is simply the sample mean of \(y\), denoted \(\bar y\).

    We draw another \(n\) observations on a different random variable \(w\). Suppose theory tells us that the mean of \(w\) is the same as the mean of \(y\). Following the same reasoning as above, we could estimate \(\mu\) using the sample mean of \(w\), \(\bar w\). But using either of these estimates alone cannot be efficient, as we are wasting the information in the sample we don’t use. Theory tells us that both of these conditions are true

    E(y) – \mu &= 0 \\
    E(w) – \mu &=0

    but we cannot generally choose \(\hat\mu\) to make both of the sample analogs of these conditions true,

    m_1 &= \bar y – \hat\mu = 0 \\
    m_2 &= \bar w – \hat\mu =0,

    so the method of moments can’t be directly applied. But we can generalize (hence, GMM) and make these two moment conditions \(m_1\) and \(m_2\) as close to being true as we can in the sense that we can make the squared deviations as small as possible. We could choose \(\hat\mu\) to
    $$ \textrm{min}_{\mu} (\bar y – \mu)^2 + (\bar w – \mu)^2,$$
    minimizing this objective yields consistent (since \(\bar y\) and \(\bar w\) are each consistent) but usually inefficient estimates, since we should take into account that \(y\) and \(w\) might have different variances and might be correlated. Intuitively, if \(w\) is much noisier than \(y\), we should place less weight on observations on \(w\) because they contain less information about \(\mu\) than observations on \(y\). Suppose for simplicity that these are independent samples and thus uncorrelated, but that the variance of \(y\) is higher than the variance of \(w\). We can get rid of these unequal variances by dividing by the standard deviations (here and throughout the post we’ll assume for simplicity that we know all the variance parameters, abstracting from much of the complication of GMM estimation) and choose \(\mu\) to
    $$ \textrm{min}_{\mu} \label{eq:gmm}
    \left ( \frac{\bar y – \mu}{\sigma_{\bar y}}\right)^2
    + \left ( \frac{\bar w – \mu}{\sigma_{\bar w}}\right )^2.$$
    Note this is equivalent to weighting each moment condition the reciprocal of its standard deviation, so that we place more weight on the more precise condition. In general the moments will not be uncorrelated, and we should take that into account too.

    We can form a test statistic against our theory that the means in these two samples are identical. Suppose we just the observations on \(y\), calculate \(\bar y\), and then check to see how well that estimate explains the observations on the other variable \(w\),

    $$ \sum_i ( w_i – \bar y)^2. $$

    If the two samples really have the same mean, then as the sample grows \(\bar y\) converges to \(\mu\), and this expression is the sum of zero-mean squared normals, and we could base a test statistic on that result. Intuitively, if our theory is false, then the \((w_i – \bar y)\) do not tend to zero mean random variables, and when we square them the results tend to be larger than if they did have zero mean.

    That’s not the best way to test our theory, however. If our theory is true then the objective tends to the sum of two squared zero-mean variables, but if our theory is incorrect the objective function tends to the sum of squared non-zero mean variables. A test can be based on this idea: if the realized value of the objective function when we minimize it would have to be very far out in the tail of the distribution obtained when the theory is correct (here, the \(\chi^2_1\) distribution), we have evidence against our theory that \(y\) and \(w\) have the same mean. This is a simple example of Hansen’s test, or the J test. Note that if we only observe one of \(y\) or \(w\) but not both, we have zero degrees of freedom left over to test the assumptions of the model and we cannot conduct this test.

    Linear regression.

    The reasoning above can be applied to a very wide variety of problems, yielding various GMM estimators depending on which variables have zero mean under some theory. Consider a univariate linear regression model of the form
    $$ y = \beta x + u, $$
    where we interpret this equation as causal: \(\beta\) is the causal effect of a one-unit change in \(x\) on \(y\) holding other causes of \(y\), \(u\), constant (and we assume that all variables have zero mean for simplicity). Suppose the data came from a randomized experiment on \(x\) and that we have a random sample. Then \(u\) and \(x\) are uncorrelated, in other words, the random variables \(x_i u_i\) have mean zero,
    $$ E [ x_i u_i ] = E[ x_i(y_i – \beta x_i) ] = 0, $$
    the sample analog of which is
    $$ \label{eq:sum} \frac{1}{n} \sum_i x_i(y_i – \beta x_i)=0.$$
    Since we have one parameter and one equation, we can always make this condition true, and the solution is easily seen to be the OLS estimator, even if the errors are heteroskedastic or correlated. We cannot test our theory that \(u\) and \(x\) are uncorrelated, since we have one parameter \(\beta\) and one equation to solve, so we can always make the sample analog of the moment condition true.

    Instrumental variables.

    Now suppose that \(x_i\) did not come from a perfect randomized experiment, instead we have observational data and no reason to suppose that causes of \(y\) we do observe (\(x\)) are uncorrelated with causes we don’t observe (\(u\)). The condition \(E( x_i u_i)=0\) no longer holds and an estimator based on that condition will have undesirable properties. But suppose we observe a variable \(z_1\) which has the property that \(z_1\) only affects \(y\) because \(z_1\) affects \(x\) (for example, assignment to the treatment group in an imperfect RCT only affects health because it affects whether patients take treatment). This assumption implies
    $$E( z_{1i} u_i ) = E [ z_{1i} (y_i – \beta x_i) ] = 0,$$
    that is, that \(z_1\) should not covary with \(y\) if \(x\) is held fixed. The sample analog of this condition gives us the method of moments estimator of \(\beta\), which turns out to be the simple linear instrumental variables estimator, the ratio of the covariance between \(y\) and \(z_1\) to the covariance between \(x\) and \(z_1\). We cannot test our theory that \(z_1\) only affects \(y\) because \(z_1\) affects \(x\) because, with one equation and one parameter, we can always find a value of \(\beta\) to make the sample analog of this condition true.

    Now suppose we have available a second instrument, \(z_2\), which theory tells us also affects \(y\) only because \(z_2\) affects \(x\).

    The diagram illustrates the model. The variable \(u\), colored red to denote that we can’t observe this variable, confounds the relationship between \(x\) and \(y\), implying that covariance between \(x\) and \(y\) does not reveal \(\beta\), the causal effect of \(x\) on \(y\).

    But we can estimate the covariances between \(y\) and \(z_1\) and between \(y\) and \(z_2\), inspection of the diagram tells us these should be equal to the \(\alpha_1\beta\) and \(\alpha_2\beta\). A one-unit increase in \(z_1\) causes an \(\alpha_1\) unit increase in \(x\), and since a one-unit increase in \(x\) causes a \(\beta\) unit increase in \(y\), a one-unit increase in \(x\) causes a \(\beta\alpha_1\) change in \(y\). And likewise for \(z_2\): the diagram tells us that covariance between \(y\) and \(z_2\) can only occur if \(\beta\ne 0\), and we can infer a value for \(\beta\) from that covariance divided by the covariance between \(z_2\) and \(x\).

    So we have two distinct causal paths, either of which allows us to estimate the causal effect of \(x\) on \(y\), just like in the introductory example we had two different ways of estimating the sample mean \(\mu\). GMM tells us how to optimally combine these two insights to produce the most precise single estimate of \(\beta\) under the theory that \(z_1\) and \(z_2\) only affect \(y\) because they affect \(x\), just like above GMM told us how to optimally combine two samples which have the same mean under some theory.

    Theory tells us that both of these conditions are true

    E(z_{1i}u_i) &= E[ z_{1i}(y_i – \beta x_i) ] = 0 \\
    E(z_{2i}u_i) &= E[ z_{2i}(y_i – \beta x_i) ] = 0 \\

    but we cannot in general choose the single parameter \(\beta\) to make both of the sample analogs of these conditions true. Suppose for simplicity that \(z_1\) and \(z_2\) are uncorrelated and that the \(u\) are heteroskedastic but uncorrelated. Then the sample analogs of the theoretical moments above have sample counterparts
    m_1 =& \frac{1}{n} \sum_i [z_{1i}(y_i – \beta x_i)]\\
    m_2 =& \frac{1}{n} \sum_i [z_{2i}(y_i – \beta x_i)]\\
    and variances \(V(m_j) = \sum_i z_{ji}^2 \sigma^2_i\), for \(j=1,2\). Then selecting \(\beta\) to
    \textrm{min}_{\beta} \left( \frac{m_1}{\sqrt{V(m_1)}}\right)^2 + \left( \frac{m_2}{\sqrt{V(m_2)}}\right)^2
    yields the GMM estimator of the causal effect of \(x\) on \(y\). As in the introductory example, the moment conditions are weighted by the reciprocal of their standard deviations, since we want to put more weight on the more precise condition. More generally, we should also take into account that \(z_1\) and \(z_2\) (and sometimes the \(u\)) will generally be correlated.

    Just like in the simple case above of estimating a mean from two samples, if our theory is true then the minimized value of the objective function is asymptotically distributed \(\chi^2_1\), so estimation by GMM produces a test of the theory as a by-product of estimation (in this context, this test stat is also called the Sargan test). Intuitively, if \(z_1\) and \(z_2\) are both uncorrelated with \(u\), then we could form the simple IV estimator using just \(z_1\), and the residuals from that exercise should be uncorrelated (up to sampling noise) with \(z_2\). If they are not, then we’re not sure what’s wrong—either \(z_1\) or \(z_2\) could be correlated with \(u\)—but we conclude that something is wrong with our theory. This is not the most efficient test, though. As in the introductory example, the value of the minimized objective function forms a test statistic against the null that our theory is correct.

    Micro applications of GMM to infer causality.

    In the preceding example, GMM allows us to estimate the causal effect of \(x\) on \(y\) using a theory that says that two variables \(z_1\) and \(z_2\) only affect \(y\) because they affect \(x\). GMM tells us how to make use of our theory to make our estimates as precise as possible, and as a by-product of estimation provides a test statistic against the null hypothesis that our theory is correct (warning: our theory could be also incorrect not because the \(z\)’s affect \(y\) for some other reason than through \(x\), but rather because the causal effect \(\beta\) varies across units in the population, see e.g. Heckman, Urzua, and Vytlacil 2006).

    GMM can be applied to much more complicated problems to estimate causal effects in a wide variety of nonlinear regression models (e.g., Windmeijer 2006), and to estimate the deep parameters in estimable choice models which can be used to produce out-of-sample predictions which sidestep the Lucas critique, e.g., Hotz and Miller (1993) or Ferrall (2012).

    ]]> 6