This is In Real Terms, a weekly column analyzing the latest economic news. Comments? Criticisms? Ideas for future columns? Email me, or drop a note in the comments.

No matter who wins next Tuesday’s election, the president who takes office next January will be among the oldest ever elected. (Donald Trump, at 70, would be the oldest president ever elected to a first term. Hillary Clinton, who turned 69 last week, would be the second-oldest after Ronald Reagan.) Perhaps that’s appropriate — the country they are hoping to lead is getting older too. When Bill Clinton took office in 1993 at age 46 — making him the third-youngest president ever — 12.6 percent of Americans were at least 65, the traditional retirement age. Today 14.8 percent are. And by 2050, that figure is expected to rise to 22.1 percent.

The aging of the U.S. population poses major economic challenges: rising healthcare costs, more retirement spending and, crucially, fewer working-age Americans to help pay for it all. Already, economists believe, the graying of America helps explain the slow economic growth of the past decade-plus. The problem will only get worse as more baby boomers leave the workforce.

But by global standards, the U.S. is in pretty good shape. In parts of Europe, more than 20 percent of the population is of retirement age; in Japan, it is 26 percent. Those countries have the same challenges as the U.S.: a large generation born after World War II that is now at or approaching retirement, and a steep decline in fertility rates. But the U.S. has something they don’t have: a high rate of immigration.

You wouldn’t know it from this year’s overheated campaign rhetoric, but immigration is the only thing keeping the U.S. from facing a Japan-style demographic cliff. At a time when aging and other factors mean that fewer Americans are working, immigrants — who tend to come to the U.S. during their working years and have a higher rate of labor-force participation than native-born Americans — play an increasingly important role in the U.S. workforce. Foreign-born U.S. residents made up 13.1 percent of the population in 2014 but 16.4 percent of the labor force, up from 10 percent two decades earlier. Immigrants help the economy in other ways too: They are more likely than native-born Americans to start businesses, and because they pay into Social Security but only receive benefits if they stay in the country permanently, they help ease the U.S.’s long-run fiscal burden.

Perhaps just as importantly, immigrants are the reason the U.S. has a relatively high birth rate compared to other rich countries. Americans, like their counterparts in Japan and western Europe, are having fewer children. But that decline has been partly offset by the comparatively high fertility rate among foreign-born residents. A report from the Pew Research Center last week showed just how big that effect is: Immigrants account for the entirety of the increase in the number of annual U.S. births since 1970. Without them, the annual number of births would have declined.

But while immigration provides the U.S. with important economic advantages, it also poses challenges. The U.S. has experienced a half-century-long wave of immigration; the foreign-born share of the population is on track to hit a record later this century. Past periods of rapid immigration have brought conflict, and the 2016 election suggests that this time will not be different.

Some of that conflict, no doubt, is driven by racism and prejudice. But there are also economic challenges. Foreign-born U.S. residents are, on average, significantly less well-educated than native-born Americans. About 28 percent of immigrants ages 25 and up have less than a high school diploma, compared to 8 percent of native-born Americans. That means they compete for work with the least educated Americans, who already face the greatest challenges finding decent-paying jobs.

Most economists firmly reject the notion that “immigrants are taking our jobs.” By providing new customers as well as new workers, immigration increases income and employment opportunities for native-born workers, leaving everyone better off on average. But the key phrase there is “on average.” There is much less agreement among economists about how low-skilled immigration affects the wages of low-skilled workers. And it is almost certain that some individual American workers are worse off because of competition from immigrants.

If that dynamic sounds familiar, it might be because it’s very similar to the debate over another major 2016 campaign issue: trade. Trade, like immigration, helps the economy as a whole, but can harm individual workers. In fact, it is largely the same workers: Americans without a college degree. Doctors and lawyers, by and large, don’t have to worry about their jobs being shipped overseas or about being displaced by an immigrant willing to do the work for less. Factory and service workers do.

In 2014, I wrote that the immigration debate hasn’t kept up with reality — it remains focused on illegal immigration from Mexico, even as illegal immigration has fallen and Asia has overtaken Latin America as a source of new arrivals. Two years later, Trump has pushed the debate even further from the facts, with his baseless claims that immigrants are rapists and criminals. (In fact, immigrants commit violent crimes at a lower rate than native Americans.) But perhaps when the election is over there will at last be an opportunity for an honest discussion of immigration, a critical source of strength for the U.S., but one that also poses serious challenges.

Are investors #withher?

Last week, I reported on new research from economists Justin Wolfers and Eric Zitzewitz that found evidence that financial markets are nervous about a Trump presidency. Friday afternoon’s “October surprise” from the FBI provided an unexpected chance to test that thesis.

In their paper, Wolfers and Zitzewitz observed that stock prices rose during the first presidential debate, which Clinton was widely seen as winning. Friday provided a similar experiment in reverse: Markets immediately plunged on the news that the FBI was looking into a new cache of emails that could be tied to Clinton’s private server. (Markets later rebounded somewhat as subsequent reporting made the news appear less dire for Clinton.)

The evidence for the “markets hate Trump” thesis isn’t definitive. It’s possible that investors were spooked by the increased uncertainty around the election outcome, rather than by the possibility that Trump’s prospects might improve. And even if investors do prefer Clinton to Trump, there is no guarantee that a surprise Trump victory would cause a long-term drop in stocks rather than a short-term blip. Still, Friday provided a convenient test of Wolfers’s and Zitzewitz’s theory, and it passed.

The week ahead

On Friday, the Bureau of Labor Statistics will release job and unemployment data for October, the last major economic figures before Election Day. The report will probably come too late to have much of an impact on the outcome. But it will at least provide some insight into the economic context in which voters are making their choice.

Economists expect the report to show that the economy added 178,000 jobs in October, which would represent a modest pickup from September, when employers added an estimated 156,000 jobs. (That figure will also be updated on Friday.) More generally, it would represent a continuation of the recent pattern of solid but unspectacular job growth. That is consistent with last Friday’s report from the Bureau of Economic Analysis that showed that gross domestic product increased at a 2.9 percent rate in the third quarter. That marked a significant pickup from the first half of the year, and beat economists’ expectations. But economists cautioned that the report didn’t suggest a sustained acceleration in economic growth.

Last week at FiveThirtyEight

AT&T’s proposed acquisition of Time Warner is already raising antitrust concerns. On Tuesday, I argued it also points to a larger issue in the U.S. economy: the increasing dominance of big corporations. (That dominance could also be bad for workers.)

In last week’s column, I interviewed Laurence Kotlikoff, an economist running a long-shot bid for the presidency. In a blog post on Monday, Kotlikoff took issue with some of my analysis.

Are you a college student? Do you enjoy FiveThirtyEight’s economics coverage? Apply to be our spring intern.

Elsewhere

Kansas, under Gov. Sam Brownback, has been running a bold test of the theory that lower taxes leads to faster economic growth. It hasn’t gone well. Brownback’s response, according to Bloomberg View’s Barry Ritholtz, has been to stop publishing a quarterly report that revealed that failure.

The current economic expansion is already among the longest on record, but that doesn’t mean the next president will necessarily face a recession, argues Neil Irwin in The New York Times. (On the other hand, simple probabilities mean a recession is more likely than not, Josh Zumbrun writes in The Wall Street Journal.)

Tyler Cowen is one of several prominent economists who has written favorably about the idea of providing a “universal basic income” to all Americans. But recently he has become more skeptical.

Local governments have slashed spending on infrastructure projects like roads and sewage systems. That’s hurting the broader U.S. economy, Eric Morath and Ben Leubsdorf report in The Wall Street Journal.

CORRECTION (Oct. 31, 7:28 a.m.): A previous version of this article incorrectly described who can receive Social Security benefits. Legal permanent residents can receive benefits, not just citizens.