Before the Fed lowered its target interest rate range on Wednesday, Donald Trump was already on Twitter, touching on two of his favorite topics: how the Fed doesn’t lower interest rates enough and that the stock market’s performance is thanks to him and his Republican pals.
The connection between a president and equity markets isn’t straightforward. Many factors—the general health of the economy, investors sentiment, interest rates, financial stimulus, and global business conditions, for example—affect how stocks perform. But presidents also aren’t unimportant.
“Policies may or may not be helpful for economic growth,” says Kenneth Orr, CEO of investment research firm and value investment fund manager KORR Acquisitions Group. “Policies are led by the President and his Administration, but Congress must pass laws and budgets to affect those policies.”
And so, as Fortune did in early June, we decided to take a look at how the markets performed during the Administrations of Barack Obama and Trump. We downloaded historical information on the Dow, S&P 500, Nasdaq, and Russell 2000 indexes from Yahoo Finance. Then we compared the same periods for both presidents: from inauguration on January 20 to Oct. 31 in their third year of office.
Because the market had already run up a long way before Trump was elected, the absolute numbers would be misleading. Instead, Fortune compared the performance under each president to his initial inauguration day to get an accurate comparison of growth under each.
Below are graphs and analysis for each of the sectors. For those who want the quick answer, market growth was considerably stronger under Obama, but there is an important caveat. The financial crash that occurred immediately before Obama took office left markets reeling, so there was a lot of room for them to move. Also, the massive financial stimulus enabled by Congress helped drive growth.
The S&P 500 is all about large companies: the 500 largest public companies on either the New York Stock Exchange (NYSE) or Nasdaq exchange as measured by market capitalization. Here is a graph showing the index’s progress under each president, again normalized so both can be compared on the same scales.
Each horizontal axis shows the number of days in office. On the vertical axis, 100% means the same value on the first day in office, which is why each line starts at 100%. Any value over 100% shows an increase (122% means 22% higher than the first day, for example) and a value under 100% shows a decrease (84% means 16% less than the first day).
The downward dip about a month in under the Obama administration is a general blow the entire market took and which appears in each graph. By the end of October 2011, the S&P 500 hit 156% of the value it had on Obama’s first day, which means the index increased by 56%. Under Trump, the increase was 34%, or 22 percentage points lower than the gain under Obama.
While the Dow (or Dow Jones Industrial Average) consists of 30 large cap companies, they are chosen specifically by Dow Jones & Company in an attempt to represent the broader economy. They are all large public companies with stable earnings that are on the NYSE or Nasdaq.
The difference in the Dow between the two administrations is significantly smaller. The percentage change under Obama was roughly 150%, meaning a 50% increase over the initial value. Under Trump, the 136% change, or 36% gain in value, was 14 percentage points less.
Nasdaq means two things. Like the NYSE, it’s a stock exchange where people can buy and sell shares. But it is also an index of stocks, many of which are high tech companies. So the Nasdaq index has come to be considered a quick way for investors to check the pulse of companies that depend heavily on innovation.
The difference here is strong. Up to now, measured from Trump’s first day, the Nasdaq has seen a 149% change for an increase of 49%. At the same point under Obama, it was a change of 186%—an icrease of 86%, or 37 percentage points more than for Trump.
All of the above indexes are either entirely or heavily large cap stocks. The Russell 2000 is the opposite: 2000 of the smallest public companies. Investors use this index to monitor the progress of smaller companies.
The Russell showed the largest difference under the two presidents. A change of 171%—a gain of 71%— during the Obama administration was a whopping 55 percentage points more than Trump’s 116% change, only a 16% increase.
But the economy climate and particulars for each president vary widely. Such factors as a generally acknowledged slowing business cycle now and the massive stimulus packages put into place as Obama took office have impacts on results. Still, it’s been a long and strong ride for the last ten years.
“Each president deserves a win,” says financial advisor and former currency trader Morris Armstrong. “I think that the government deserves collective credit for keeping our economy afloat, that the early bounce is easier than the mature bounce.”
As to whoever wins in 2020? “The next president will likely have a recession as an inauguration gift,” Armstrong says.
—“Secret” recession signs may provide clues to when the next downturn is coming
—The HENRYs—high earners, not rich yet—may finally be having their moment
—Markets are betting that good things —Why Virgin Galactic sidestepped a traditional IPO, according to its CEO
—Don’t miss the daily , Fortune’s newsletter on deals and dealmakers.