For my sins, I have done more than my fair share of analysis in Excel. I am quite capable of building and maintaining 130Mb spreadsheets (I had a dozen of them for one client). Excel is pretty much installed everywhere, so it is sometimes the only way to get started getting commercial value of the data in the organisation. But I don’t like it and let’s have a look at one reason why. In order not to always pick on Microsoft, we use another application, but you get the same results with Excel.
Spreadsheets are good for some things, but analysing data is not one of them. The example data in the table on the right is from Jeffrey S. Simonoff, “Statistical analysis using Microsoft Excel” (2008), and looks at first (and maybe even second) glance like a reasonable set of observations.
However, the predictors are (accidentally) collinear so no meaningful fit is possible, unless one of them are dropped. We see that very easily if we try to do the analysis using the R statistical computing and analysis platform:
Everybody likes to pick on Excel, so let us load the data into version 3.3.2 of LibreOffice, the free Open Source personal productivity suite, instead. It faithfully implements many of the worst features of Excel. You can grab a copy of the spreadsheet GS-spreadsheet-error.ods yourself and see the results. The relevant function in both Excel and LibreOffice for linear regression is LINEST and applying it to the data set give us:
Of the 16 values returned by the function, fully 12 of them are incorrect (highlighted in red), and the ‘#VALUE!’ entries are the only thing that suggests we may have a problem. (The ‘#N/A’ values are a feature of the function and not a problem.) Excluding the X4 values from the function call gives meaningful (and correct) results:
There is so much wrong with doing even this trivial analysis in a spreadsheet that it is hard to know where to start. Some of the problems:
- Garbage results instead of errors
- Instead of giving meaningful errors or warnings, the spreadsheets simply produce garbage results. This is nearly impossible to debug.
- No help on how to correct the problem
- In the erroneous results of the first figure, there is no clue, no hint, no help to figure out how to correct the problem. You could argue about R correcting the issue ”automagically”, but at least it finds a solution to the problem and tells you about it.
- Error prone output formats
- I put in the row and column headings because otherwise it is just too hard to read the data. Where does the function stuff the F statistics again?
And don’t get me started on version control and documentation. Don’t even mention that the maths in Excel are wrong. Don’t bring up the list of academically researched spreadsheet horror stories. Just remember: Friends do not let friends do data analysis in spreadsheets.