Thanks very much – it is (amazingly) a topic which has been on my mind lately. Just don’t expect me to read it quickly
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Statistical flaws in Excel (Excel 97 / 2000 / XP)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Statistical flaws in Excel (Excel 97 / 2000 / XP)
- This topic has 12 replies, 5 voices, and was last updated 17 years, 2 months ago.
AuthorTopicWSWebGenii
AskWoody LoungerJuly 3, 2003 at 3:25 pm #389984Viewing 0 reply threadsAuthorReplies-
WSHans Pottel
AskWoody LoungerMarch 12, 2008 at 8:53 pm #690979Edited by HansV to re-attach the zipped document, it was lost in the server crash of August 2007
Many people, including myself, use Excel’s statistical functions and the Analysis Toolpak. However, Excel has some flaws that you should know when you are using these tools. I summarized many of these flaws in one document, which I wanted to present to the forum. I would appreciate your comments and suggestions.
It’s a zipped pdf document to reduce it to the acceptable file size for uploading. -
WSHansV
AskWoody Lounger -
WSpieterse
AskWoody LoungerJuly 4, 2003 at 4:45 am #691124Hi Hans,
Excellent article!
Would it be OK if I posted this article in the Microsoft Excel MVP newsgroup?
A message I sometimes refer to with regards to Excel’s poor Stat qualities:
==========
From: Jerry W. Lewis (JWLewis53@mediaone.net)
Subject: Re: LINEST with r2 = -1.18 ???
Newsgroups: microsoft.public.excel.worksheet.functions
View: Complete Thread (35 articles) | Original Format
Date: 2001-09-26 06:40:28 PSTLINEST() (also SLOPE(), INTERCEPT(), VAR(), STDEV(), LOGEST(), TREND(),
FORECAST(), etc.) uses a numerically unstable algorithm. With
challenging data (such as yours), rounding error has accumulated to the
point that none of its calculations (slope, intercept, etc.) can be
believed. In your case, you were lucky enough to get an impossible R^2,
so that it was obvious that there was a problem. There may still be a
problem even with data that give more reasonable R^2 values. These
problems with Excel’s algorithms have been well documented for years
(cf. Sawitzki, 1994, “Report on the reliability of data analysis
systems” Comput. Statist. Data Anal. 18:289-301) yet Microsoft continues
to ignore them.Harlan Grove’s matrix formulation simply recreates the same problem.
DEVSQ(), COVAR(), and CORREL() are the only 2nd moment functions in
Excel that are numerically reliable. For simple linear regression, use
the following formulas instead of LINEST(), SLOPE(), INTERCEPT(), RSQ(),
STEYX(), etc.slope = COVAR(y,x)/DEVSQ(x)*COUNT(y)
intercept = AVERAGE(y) – slope*AVERAGE(x)
rsq = CORREL(y,x)^2
SSreg = rsq*DEVSQ(y)
SSresid = (1-rsq)*DEVSQ(y)
df = COUNT(y)-2
F = SSreg/SSresid*df
steyx = SQRT(SSresid/df)
se1 = steyx/SQRT(DEVSQ(x))
seb = steyx/SQRT(1/COUNT(y)+AVERAGE(x)^2/DEVSQ(x))This approach has the added advantage over LINEST that it allows missing
values in the data range. However that cuts both ways, because they
will give a wrong answer if there are data pairs where only x or y (but
not both) are missing.Similarly, for univariate statistics use the following formulas instead
of VAR(), VARP(), STDEV(), and STDEVP()var = DEVSQ(x)/(COUNT(x)-1)
varp = DEVSQ(x)/COUNT(x)
stdev = SQRT(var)
stdevp = SQRT(varp)Since Microsoft has already programmed routines that would be superior
to their unstable routines, it is puzzling why they continue to maintin
redundant inferior code. The unstable formulas that Excel programed are
mathematically exact (with infinite precision), so my formulas will
agree with the Excel functions for non-challenging data sets. When they
disagree, the dedicated Excel functions are wrong.There is no DEVSQA function, there is no hel for VARA(), VARPA(),
STDEVA(), or STDEVPA() other than doing those calculations manually.If you are wedded to using LINEST(), then test to see if
STDEV(x) = SQRT(DEVSQ(x)/COUNT(x))
STDEV(y) = SQRT(DEVSQ(y)/COUNT(y))
PEARSON(y,x) = CORREL(y,x)If all three of these are approximately true (say to at least 12 figures
each), then LINEST() can probably be believed for simple linear
regression. Figuring out when LINEST() can be believed for more complex
models is not so simple.Jerry
Richard Nolan wrote:
> Having used LINEST for Linear regression, I think
> successfully a few times, I now have a data set that
> returns an r2 value of -1.18, which is not possible. I can
> look at the data and tell r2 must be +, not negative.
>
> Are there two logic problems with LINEST. (a) r2 can never
> greater than +/- 1, and (I can see the relationship is
> +, not -. -
WSHans Pottel
AskWoody Lounger -
WSpieterse
AskWoody Lounger
-
-
-
WSWebGenii
AskWoody Lounger -
WSHansV
AskWoody LoungerJune 18, 2007 at 8:40 pm #1068928Nope, but some of the issues were addressed in Excel 2003 – see Description of improvements in the statistical functions in Excel 2003 and in Excel 2004 for Mac and also Statistics:Numerical Methods/Numerics in Excel As far as I know, no significant changes were made in this area in Excel 2007.
For an exhaustive review of the weaknesses of statistics in all versions of Excel, including Excel 2007, see Errors, Faults and Fixes for Excel Statistical Functions and Routines (as of May/21/2007). -
WSWebGenii
AskWoody LoungerJuly 11, 2007 at 3:40 pm #1071515Just ran across this
http://www.robweir.com/blog/2007/07/formula-for-failure.html%5B/url%5D
Am I right in thinking that these problems only come to light if the spreadsheet is saved in XML format? -
WSHansV
AskWoody LoungerJuly 11, 2007 at 6:44 pm #1071547That article refers to the Office Open XML format, which is used as default in Office 2007 for workbooks without macros; the file extension is .xlsx. I don’t know whether the implementation in Excel 2007 actually includes the errors mentioned in the article, or whether they are merely errors in the description of the format.
-
-
-
-
WSdiegol
AskWoody Lounger
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Xfinity home internet
by
MrJimPhelps
4 hours, 3 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
6 hours, 2 minutes ago -
Debian 12.11 released
by
Alex5723
14 hours, 28 minutes ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
18 hours, 10 minutes ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
4 hours, 33 minutes ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
14 hours, 38 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
1 day, 11 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
1 day, 1 hour ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
1 day, 13 hours ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
1 day, 6 hours ago -
Some advice for managing my wireless internet gateway
by
LHiggins
13 hours, 34 minutes ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
6 hours, 25 minutes ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
1 day, 23 hours ago -
Sometimes I wonder about these bots
by
Susan Bradley
1 day, 19 hours ago -
Does windows update component store “self heal”?
by
Mike Cross
1 day, 9 hours ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
2 days, 13 hours ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
21 hours, 9 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
9 hours, 47 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
2 days, 15 hours ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
2 days, 15 hours ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
2 days, 4 hours ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
3 days ago -
0Patch, where to begin
by
cassel23
2 days, 18 hours ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
3 days, 13 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
3 days, 1 hour ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
3 days, 22 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
3 days, 13 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
15 hours, 23 minutes ago -
Installer program can’t read my registry
by
Peobody
7 hours, 17 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
3 days, 10 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.