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 LoungerViewing 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
-
Cox Communications and Charter Communications to merge
by
not so anon
2 hours, 15 minutes ago -
Help with WD usb driver on Windows 11
by
Tex265
1 hour, 23 minutes ago -
hibernate activation
by
e_belmont
5 hours, 9 minutes ago -
Red Hat Enterprise Linux 10 with AI assistant
by
Alex5723
8 hours, 56 minutes ago -
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
12 hours, 1 minute ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
12 hours, 3 minutes ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
15 hours, 13 minutes ago -
Out of band for Windows 10
by
Susan Bradley
16 hours, 46 minutes ago -
Giving UniGetUi a test run.
by
RetiredGeek
23 hours, 43 minutes ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
1 day, 7 hours ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
1 day, 5 hours ago -
Auto Time Zone Adjustment
by
wadeer
1 day, 11 hours ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
1 day, 9 hours ago -
Manage your browsing experience with Edge
by
Mary Branscombe
14 hours, 5 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
2 hours, 30 minutes ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
8 hours, 55 minutes ago -
Apps included with macOS
by
Will Fastie
6 hours, 46 minutes ago -
Xfinity home internet
by
MrJimPhelps
3 hours, 34 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
1 day, 4 hours ago -
Debian 12.11 released
by
Alex5723
2 days, 8 hours ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
2 days, 12 hours ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
1 day, 16 hours ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
1 hour, 26 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
3 days, 5 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
2 days, 19 hours ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
17 hours, 41 minutes ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
3 days ago -
Some advice for managing my wireless internet gateway
by
LHiggins
2 days, 8 hours ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
1 day, 10 hours ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
3 days, 17 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.