Wilbur Ross, the commerce secretary, defended the lumber tariffs. "Anti-dumping and countervailing duty determinations provide the domestic industry with relief from dumping and improper subsidies," he said in a statement to The New York Times last week. "Price fluctuations from other factors are not part of the calculus."

Those tariffs, which took effect last year, combined with other factors to drive up the price of lumber in the United States. As a result, the anti-dumping and countervailing duties, as the tariffs are officially known, have added to the cost of housing in the United States at a time when homes are becoming less affordable. The Trump administration's tariffs on steel and aluminum, and any others that follow, could also contribute to rising costs for businesses and consumers.

Long before the sharp clash with Canada at the Group of 7 meeting this weekend, the Trump administration imposed tariffs on lumber imports from Canada, which American home builders use in large quantities. The United States Commerce Department contended that Canadian companies were selling lumber into the United States at unfair, subsidized prices.

Look no further than the lumber that goes into many houses in the United States.

Want to better understand what may happen in the United States economy as President Trump pursues his combative trade policies?

Tariffs might be expected to push up the price of a good to a certain level, but in this case, the price of Canadian lumber kept rising.

The cost of 1,000 board feet of western Canadian lumber is up nearly 80 percent over the past 12 months, including about 40 percent this year, according to data from Random Lengths, a publication that covers the lumber market.

What caused this unusual rise? Paul F. Jannke, a principal at Forest Economic Advisors, a firm that analyzes the lumber market, said that the tariffs had contributed to the ascent. But, he added, a reduction in the supply of Canadian lumber, caused by recent rail slowdowns and tree disease, played a big role. Mr. Ross, in his statement, noted these causes.

"The prices have gone up by much more than the tariffs because of supply and demand factors," he said. "The purpose of the tariffs was to level the playing field for the Americans."

In the first quarter of 2018, the United States imported 3.07 billion board feet of Canadian lumber, down 15 percent from 3.63 billion board feet a year earlier, according to data from Forest Economic Advisors. Also, Canadian lumber imports in the first quarter were equivalent to 36 percent of United States domestic lumber production, down from 42 percent in all of 2017.

Is this evidence that the tariffs have priced the Canadians out of the United States market, allowing American producers to fill the gap? Probably not. The declines in Canadian shipments are more the result of tree disease and the slower rail transportation than tariffs, Mr. Jannke said. Also, United States lumber production does not appear to be growing at a faster rate. In the first quarter, it was up 3 percent over a year earlier. In 2017, it grew at a 4.4 percent annual rate. It will take a long time for American producers to add a significant amount of new capacity, Mr. Jannke added.

Large Canadian lumber producers have done well financially despite the trade friction. The stock of West Fraser Timber, a big Canadian producer, has gained 53 percent in the last 12 months, and its 2018 first-quarter earnings rose 60 percent from a year earlier.

"The tariffs did not constrain Canadian production nor was that their purpose," Mr. Ross said in his statement. "Their purpose was to protect the U.S. lumber industry from subsidized softwood lumber dumping. These tariffs will be most beneficial to the U.S. producers in the next down cycle. In an up cycle, everyone benefits."

But such words may not satisfy United States home builders, who are grappling with the much higher lumber prices while other costs — like wages — are also going up.

"We've had conversations with the White House, Secretary Ross directly and the U.S. trade representative," said Jerry Howard, chief executive of the National Association of Home Builders. "We are trying to sound the alarm here."

Despite the rise in housing prices, the number of homes being built has not picked up to the levels of past upswings.

In the past 12 months, monthly housing starts, expressed at an annual rate, have averaged 1.24 million units, well below the 1.96 million average units from 2003 through 2005.

For now, many home builders are passing on their higher costs to home buyers. In recent months, executives from publicly traded home builders have told their shareholders that they expect to maintain their profit margins even as their costs rise.

The profitability of home builders has not escaped Mr. Ross's notice. "Home prices have risen by much more than the increase in lumber prices, and this is reflected in the strong profit margins of the home builders," he said.