bugPSPP - Bugs: bug #43768, Histogram in FREQUENCIES incorrect

 
 

bug #43768: Histogram in FREQUENCIES incorrect

Submitter:  Daniel Schlieper <daniel_schlieper>
Submitted:  Sat 06 Dec 2014 03:26:09 PM UTC
   
 
Category:  Numerical Errors Severity:  5 - Average
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  None
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 07 Dec 2014 08:03:37 PM UTC, comment #5: 

I agree: The patch is insignificant for the purpose of copyright. But I am also happy to give a copyright assignment or disclaimer.

Thank you for accepting the patch.

Best regards, Daniel

Daniel Schlieper <daniel_schlieper>
Sun 07 Dec 2014 05:36:56 PM UTC, comment #4: 


> Would the attached diff file be sufficient to point out the differences?


Thanks for the patch!  I applied this to master, slightly edited.

(This patch is borderline for what FSF calls "insignificant for the purpose of copyright".  For a larger contribution, we would probably need to get a copyright assignment or disclaimer.)

Ben Pfaff <blp>
Group administrator
Sun 07 Dec 2014 01:50:52 PM UTC, comment #3: 

Would the attached diff file be sufficient to point out the differences?

Best regards, Daniel

(file #32617)

Daniel Schlieper <daniel_schlieper>
Sun 07 Dec 2014 12:12:27 PM UTC, comment #2: 

Thank you very much, this is good to know. It's not a bug then, but just a point that is missing in the documentation.

Best regards, Daniel

Daniel Schlieper <daniel_schlieper>
Sat 06 Dec 2014 06:54:04 PM UTC, comment #1: 

I don't think it is right to say that either histogram is "incorrect".  For any dataset, there are an infinite number of possible histograms.  The difference is that they have different number of bins. 

In particular, the EXAMINE command uses Sturges Rule[1] to determine the bin_width, whereas FREQENCIES uses the Freedman-Diaconis rule[2].  The former is generally regarded as being better for a small number of data, but not so good for large datasets.


[1] http://www.syque.com/improvement/Sturgess%20Rule.htm
[2] https://en.wikipedia.org/wiki/Freedman%E2%80%93Diaconis_rule

John Darrington <jmd>
Group administrator
Sat 06 Dec 2014 03:26:09 PM UTC, original submission:  

Hello,

the histogram from FREQUENCIES gives an incorrect result. EXAMINE gives a correct histogram.

Best regards, Daniel Schlieper

Example: pspp (GNU PSPP) 0.8.4 on OpenSUSE 12.3

pspp -O charts=hbr-#.png

get data /type=ods /file='hbr.ods' /cellrange=range 'A1:B76'.
freq Value /histogram.
exa Value /plot=histogram.

hbr-1.png is from FREQ (and wrong)
hbr-2.png is from EXAMINE (and correct)

Frequencies gives the correct numbers in the output table.

Daniel Schlieper <daniel_schlieper>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #32617:  statistics.texi.diff added by daniel_schlieper (749B - text/x-patch - Diff file to explain the diffenet behaviour of histograms in FREQ and EXA.)
file #32609:  hbr.ods added by daniel_schlieper (11KiB - application/vnd.oasis.opendocument.spreadsheet - see text)
file #32610:  hbr-1.png added by daniel_schlieper (12KiB - image/png - see text)
file #32611:  hbr.sav added by daniel_schlieper (632B - application/x-spss-sav - see text)
file #32612:  hbr-2.png added by daniel_schlieper (14KiB - image/png - see text)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by blp (Posted a comment)
  • -email is unavailable- added by jmd (Posted a comment)
  • -email is unavailable- added by daniel_schlieper (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-12-07 blp StatusNone Fixed
        Open/ClosedOpen Closed
    2014-12-07 daniel_schlieper Attached File- Added statistics.texi.diff, #32617
    2014-12-06 daniel_schlieper Attached File- Added hbr.ods, #32609
        Attached File- Added hbr-1.png, #32610
        Attached File- Added hbr.sav, #32611
        Attached File- Added hbr-2.png, #32612

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code