bugPSPP - Bugs: bug #50366, calculation of variance under...

 
 

bug #50366: calculation of variance under frequencies only give mean

Submitted by:  None
Submitted on:  Tue 21 Feb 2017 12:42:50 PM UTC  
 
Category: Numerical ErrorsSeverity: 5 - Average
Status: FixedAssigned to: None
Open/Closed: ClosedRelease: None
Effort: 0.00

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 21 Feb 2017 02:57:54 PM UTC, comment #3:

I added a test and your proposed patch:

http://git.savannah.gnu.org/cgit/pspp.git/commit/?id=3db3eb092e5ea941d815e6377ecdb5ea260a5a25

Thanks for your help!!!

Friedrich

Friedrich Beckmann <beckmanf>
Project Member
Tue 21 Feb 2017 02:13:45 PM UTC, comment #2:

Sorry, I only looked at the descriptives command...

The following shows the problem with the FREQUENCIES command:

The output is:

I think your patch proposal is correct.

Friedrich Beckmann <beckmanf>
Project Member
Tue 21 Feb 2017 01:38:11 PM UTC, comment #1:

Hi,

thank you for your bug report. I could not reproduce the problem with version 0.10.2 on MacOS. I tried:

and the output is

Could you maybe state your Operating System and pspp version?

Thanks

Friedrich

Friedrich Beckmann <beckmanf>
Project Member
Tue 21 Feb 2017 12:42:50 PM UTC, original submission:

data list list /forename (A12) height.
begin data.
Ahmed 188
bertram 167
Catherine 134.231
David 109.1
end data

Descriptives variables = height
/statistics = variance.

  • output.
  • variable N Variance
  • height 4 1217.92 .

Frequencies variables = height
/statistics = variance.

  • output.
  • N Valid 4 .
  • Missing 0 .
  • Mean 149.58 .
  • Bugs, the result of Frequencies for statistis
  • should be a Variance
  • but came out a Mean value

I finally found in src/langauge/stats/frequencies.c

else if (lex_match_id (lexer, "VARIANCE"))
{
frq.stats |= BIT_INDEX (FRQ_ST_MEAN);
change to:
else if (lex_match_id (lexer, "VARIANCE"))
{
frq.stats |= BIT_INDEX (FRQ_ST_VARIANCE);

will fix the bug. Thanks

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by beckmanf (Posted a comment)
  •  

    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 logged-in users 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
    Tue 21 Feb 2017 02:57:54 PM UTCbeckmanfStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Tue 21 Feb 2017 02:13:45 PM UTCbeckmanfStatusCannot Reproduce=>In Progress
    Tue 21 Feb 2017 01:38:11 PM UTCbeckmanfStatusNone=>Cannot Reproduce

    Back to the top


    Powered by Savane 3.1-cleanup1