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

 
 

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

Submitted by:  None
Submitted on:  Tue 22 Dec 2015 01:52:06 PM UTC  
 
Category: Graphical User InterfaceSeverity: 3 - Ordinary
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.

 

(Jump to the original submission 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>
Project 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>
Project 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>
Project 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>
Project 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 File(s):
   
   
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
  • -unavailable- added by jmd (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 04 Jan 2016 07:46:26 PM UTCjmdStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 31 Dec 2015 06:41:54 PM UTCjmdSeverity5 - Average=>3 - Ordinary
    Wed 30 Dec 2015 04:36:43 PM UTCjmdCategoryNone=>Graphical User Interface
    Tue 22 Dec 2015 01:52:45 PM UTCNoneAttached File-=>Added binary.sav, #35839
    Tue 22 Dec 2015 01:52:06 PM UTCNoneAttached File-=>Added IEyOUnO.png, #35837
      Attached File-=>Added W5Q4lTI.png, #35838

    Back to the top


    Powered by Savane 3.1-cleanup1