President Donald Trump's administration is renegotiating the North American Free Trade Agreement and has threatened to withdraw from it.

This has led to a spike in the cost of lumber, a major Canadian export to the US, amid rising costs of land and construction workers.

According to Capital Economics, higher lumber prices could prompt homebuilders to focus on more-expensive housing to protect their margins, even with a shortage of affordable housing relative to demand.

NAFTA is intact, for now, following threats by President Donald Trump to withdraw from it. But the back-and-forth between the US and its neighbors over trade is already shaking up a key component of the housing market, with more disruptions possible.

America is the largest importer of softwood lumber from Canada. Concerns that the US would withdraw from the North American Free Trade Agreement — which includes Canada as well as Mexico — have contributed to a jump in lumber prices since early this year. The benchmark random-length lumber futures contract jumped last week to $440 per thousand square feet, its highest in 4 1/2 years.

Matthew Pointon, a property economist at Capital Economics, estimated that, based on a typical requirement of 20,000 square feet of lumber for a new home, the price increase since November added $2,000 to the cost of construction. That's less than 1% of the median price of a home.

"Given that lumber accounts for a relatively small share of overall construction costs, on its own that development will have a minimal impact on homebuilding activity," Pointon said in a note on Tuesday.

But what it could have an impact on, Pointon said, is the type of homes being built. Pressures from higher land and labor costs have been encouraging builders to construct smaller single-family homes, Pointon said in a recent note. Prices are unlikely to shrink with home sizes, however, because demand remains hot in a strong economy.

Prioritizing more-expensive homes could become another way to protect margins, even as more-affordable housing remains in short supply, especially in larger cities.

That, according to Pointon, is the worrying combination that could slow down housing starts and tighten the nonluxury section of the market even more.

"Combined with labor and land shortages it will only add to the pressure on builders to protect margins by focusing on the higher end of the housing market," Pointon said.