Unexpected results from LinearModelFit

I’m struggling to understand why Mathematica 13.1 gives multiple linear regression coefficients that are greatly different from the Data Analysis package in Excel and Maple’s LinearFit function.

I’m assisting a colleague who is using Excel to find a model for data with 4 independent variables and 1 response variable. All she had access to was Excel, and I attempted to extol the virtues of Mathematica.

Assuming she had selected a reasonable approach, (exponential fitting by transforming the response variable to ln(y)), I tried to duplicate that effort in Mathematica. (Then I would go on to try nonlinear regression.)

But I came up with regression coefficients that were vastly different. I assumed Excel was wrong, so I used Maple to confirm. Nope. Maple agrees with Excel. Even the multiple linear regression calculator on Statistics Kingdom agrees with Excel and Maple. https://www.statskingdom.com/410multi_linear_regression.html

Notebook is attached. Please see the “subsubsection” entitled “exponential”. A screenshot from Excel is embedded for comparison. I used the “ParameterTable” option to show the coefficients.

So, I think that Mathematica is reporting what I don’t understand. Does anyone have any ideas?

Thanks!

raw data.xlsx (39.4 KB)
regression modeling.nb (607 KB)

Hi Glen,

There is an error during the evaluation of dataTransformed so it is not transformed.

dataTransformed == data
(* True *)

Try

dataTransformed = ReplaceAt[data, y_ :> Log@y, {All, 5}] /. Indeterminate -> 0

Thank you!

I didn’t even think of using ReplaceAt. I had thought Delete then AppendTo was changing the list.

Well, heck!

That was simple…