bugGNU Octave - Bugs: bug #48077, CI not correct in ttest

 
 

bug #48077: CI not correct in ttest

Submitted by:  Andreas Stahel <sha1>
Submitted on:  Wed 01 Jun 2016 02:19:02 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Tony RichardsonOpen/Closed: Closed
Release: 4.0.2Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 20 Apr 2017 09:38:45 AM UTC, comment #4:

The modification added to fix the confidence interval makes ttest to crash when testing paired samples. A simple script like this:

pkg load statistics;

x = random("normal", 0.0, 1.0, [100, 1]);
y = random("normal", 0.0, 1.0, [100, 1]);

ttest(x, y); % crashes

...produces the following error

error: ttest: operator +: nonconformant arguments (op1 is 2x1, op2 is 100x1)
error: called from
ttest at line 123 column 10

On line 123, the term my is added to ci. For paired testing, addition of that term is not needed (and its dimension is not consistent with the size of ci).

I have attached the ttest_crash.m file to reproduce the error.

(file #40449)

Álvaro Bertelsen <abertelsen>
Wed 01 Jun 2016 05:18:41 PM UTC, comment #3:

Thanks for reporting, I corrected it now

Nir Krakauer <nir_krakauer>
Wed 01 Jun 2016 02:55:21 PM UTC, comment #2:

The actual result is
ci = -0.37811 0.37811

the correct result should be

ci = 9.6219 10.3781

Matlab produces the second result and hand computation confirm it.

Andreas Stahel <sha1>
Wed 01 Jun 2016 02:42:34 PM UTC, comment #1:

Can you please specify what returned result is, and what it should be?

Nir Krakauer <nir_krakauer>
Wed 01 Jun 2016 02:19:02 PM UTC, original submission:

The computed CI is not quite correct

Andreas Stahel <sha1>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #40449:  ttest_crash.m added by abertelsen (137B - text/plain)
file #37330:  Test_ttest.m added by sha1 (174B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by abertelsen (Updated the item)
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by nir_krakauer (Posted a comment)
  • -unavailable- added by sha1 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 20 Apr 2017 09:38:45 AM UTCabertelsenAttached File-=>Added ttest_crash.m, #40449
    Thu 02 Jun 2016 03:44:14 AM UTCmtmillerStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 01 Jun 2016 02:38:52 PM UTCsha1Attached File-=>Added Test_ttest.m, #37330

    Back to the top


    Powered by Savane 3.1-cleanup1