Bug 104899 - Data Analysis T test error in formula for standard error of the difference of sample means
Summary: Data Analysis T test error in formula for standard error of the difference o...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2016-12-24 01:38 UTC by ejbarth
Modified: 2018-11-05 23:07 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
The attached shows bug in Data Statistics T test (19.89 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-12-24 01:38 UTC, ejbarth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ejbarth 2016-12-24 01:38:35 UTC
Created attachment 129912 [details]
The attached shows bug in Data Statistics T test

in Data Statistics T-test:

t statistic is currently computed using a formula like this:
=($Sheet3.$E$21 - $Sheet3.$E$15) / ($Sheet3.$E$22 / ( $Sheet3.$E$23 + 1)) ^ 0.5


This leads to p values that are approximately half the correct values.

The t statistic should use a formula like this:
=(F17-E17)/SQRT(E18/E19+F18/F19)
the terms in the square root are

s1^2/n1 + s2^2/n2

This correction leads to results which are comparable to the cell function t.test
Comment 1 Buovjaga 2016-12-31 18:21:04 UTC
raal: any idea about this?
Comment 2 Xisco Faulí 2017-10-31 19:05:51 UTC
(In reply to Buovjaga from comment #1)
> raal: any idea about this?

@Raal, do you have any idea about it?
Comment 3 Xisco Faulí 2018-01-11 09:02:07 UTC
M.a.riosv, do you have any idea about this?
Comment 4 m.a.riosv 2018-01-11 09:41:58 UTC
No, sorry.
Comment 5 Jean-Baptiste Faure 2018-03-11 11:43:38 UTC
@ ejbarth@gmail.com : Please could you explain what values in your test file should be compared to see if it works as expected or if there is a problem. In your file I see one red cell and 2 yellow cells. 

Could you provide a reference showing that your own computations are correct.

Did you try with current version of LibreOffice ? Which version did you use ? With LO 6.0.2 I do not see the ratio of 2 between values computed by your test file. Please provide more detailed explanations.

Set status to NEEDINFO, please set it back to UNCONFIRMED once requested
informations are provided.

Best regards. JBF
Comment 6 QA Administrators 2018-10-09 11:26:48 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2018-11-05 16:13:20 UTC Comment hidden (obsolete)
Comment 8 Regina Henschel 2018-11-05 23:07:37 UTC
I think, that the attached document compares the wrong functions. The wizard calculates a "Paired t-test". Therefore the variables need to have the same count of samples and you need to compare it with T.Test with type=1.

If I call the wizard with 170 values from both F and M and use the T.Test function with type=1, I get the same result.