bugPSPP - Bugs: bug #46749, logistic regression function...

 
 

bug #46749: logistic regression function having problems with categorical variables

Submitter:  None
Submitted:  Tue 22 Dec 2015 01:52:06 PM UTC
   
 
Category:  Graphical User Interface Severity:  3 - Ordinary
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  None
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 04 Jan 2016 07:46:26 PM UTC, comment #7: 

I have checked in a series of changes which I think addresses this issue.  Closing this item as done.

If you think it needs more work, please reopen.

John Darrington <jmd>
Group administrator
Sat 02 Jan 2016 12:38:32 PM UTC, comment #6: 

great. thanks.

happy new year

Anonymous
Thu 31 Dec 2015 06:41:54 PM UTC, comment #5: 

I see.

I suppose we can do something similar.

John Darrington <jmd>
Group administrator
Thu 31 Dec 2015 02:14:47 PM UTC, comment #4: 

SPSS takes the measure indicator of the variable under consideration. if any variable has "scale" option selected under measure indicator, /CATEGORICAL option is ignored in the syntax.

however, if any variable has "nominal" or "ordinal" selected under measure indicator, /CATEGORICAL option is automatically implemented. nothing additional needs to be done on the user side.

it is one of the reason why i missed the feature in psppire. did not think of checking the syntax option.

Anonymous
Wed 30 Dec 2015 04:36:43 PM UTC, comment #3: 

I see.

I can think of a couple of ways of resolving this.

Do you know how the SPSS gui solves this?

John Darrington <jmd>
Group administrator
Wed 30 Dec 2015 02:11:02 PM UTC, comment #2: 

i was not using syntax. rather the psppire GUI (hence point number 5 mentioned go to: analyse -> regression-> logistic regression).

it was probably a mistake to use the GUI only; and not the syntax as well. however, in the GUI, i could not find any option to indicate which variables are categorical. how to produce /CATEGORICAL from the psppire GUI.

ideally, while using psppire, it should automatically identify which variables are categorical.

one of the possible bypass could be;- using psppire, after selecting the variables, instead of pressing "Ok", press "paste". then add the "/Categorical" option and then run the syntax. a bit cumbersome, but will do the job for now.

Anonymous
Wed 23 Dec 2015 09:46:05 AM UTC, comment #1: 

I cannot reproduce this, but I expect you are using it wrong.

If you want a variable to be treated as a categorical variable, then you need to specify "/categorical".  This is explicitly  mentioned both in the user manual, and in the tutorial which you linked.  Here is the syntax which that tutorial gives as an
example:

 logistic regression admit with gre gpa rank
   /categorical = rank.

when I run that, I get exactly the same results as in the tutorial.

Can you confirm exactly which syntax you are running?

John Darrington <jmd>
Group administrator
Tue 22 Dec 2015 01:52:06 PM UTC, original submission:  

short description: while doing the logistic regression, pspp completely ignores "measure" of the variable. it is treating categorical variable as a continuous variable leading to wrong results.

complete description:
1) for reporting this, i am using the example given in this SPSS tutorial-
http://www.ats.ucla.edu/stat/spss/dae/logit.htm
2) look at the example dataset - binary.sav
3) open the file.
4) it contains four variables. two nominal (admit and rank) and two scale (gre and gpa)[visible in the "measure" of variable view].
5)go to: analyse -> regression-> logistic regression
6)select admit as the dependent variable and rank,gre and gpa as the independent variable.


expected result: the output should look like this - http://i.imgur.com/W5Q4lTI.png

actual result in pspp: http://i.imgur.com/IEyOUnO.png

7) possible reason: pspp ignores the measure indicator of the variable. it treats rank as a continuous variable.

8) this is a long term problem and it exists since the function is available in pspp. did not report it as was unable to confirm the expected result from SPSS.

9) interestingly, if this file is imported in R and logistic regression analysis done, expected result takes place.


pspp version:

psppire 0.8.5 (problem present since logistic regression function added in PSPP)

system information (uname -a):

Linux 4.2.0-21-generic #25~14.04.1-Ubuntu SMP Thu Dec 3 13:55:58 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35839:  binary.sav added by None (8KiB - application/x-spss-sav)
file #35837:  IEyOUnO.png added by None (43KiB - image/png)
file #35838:  W5Q4lTI.png added by None (29KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jmd (Posted a comment)
  •  

    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
    2016-01-04 jmd StatusNone Fixed
        Open/ClosedOpen Closed
    2015-12-31 jmd Severity5 - Average 3 - Ordinary
    2015-12-30 jmd CategoryNone Graphical User Interface
    2015-12-22 None Attached File- Added binary.sav, #35839
    2015-12-22 None Attached File- Added IEyOUnO.png, #35837
        Attached File- Added W5Q4lTI.png, #35838

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code