SPSS Statistics

 View Only
  • 1.  Logistic regression / categorical variable

    Posted Fri December 18, 2020 06:01 PM

    Hi everyone,

    I need some help here!

    How can I transform a variable with 3 groups (1st group: N= 358, 2nd group: N= 419 and 3 group N =127) in two groups which will include the N=127 of the 3rd group and a equal sample of 127 randomly selected from the other 2 groups (1st and 2nd)  ?

    I wanna this dependent variable for the Logistic Regression analysis.

    Many thanks in advance!

    :)



    ------------------------------
    Sandy Lioupi
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Logistic regression / categorical variable

    Posted Sat December 19, 2020 09:34 AM
    It is certainly possible to do this, but I question whether this is a good idea.   Why do you want to do this?  What are the three groups?  This would just make it more difficult to understand the group impact.

    You might consider, instead, multinomial logistic regression.

    --





  • 3.  RE: Logistic regression / categorical variable

    Posted Sat December 19, 2020 01:20 PM

    Thanks for your reply!

    The first two groups are non internet addiction and the third group is internet addiction.

    I actually wanna do this, because I was asked to.

    Would you please help me further with this?

    Many thanks in advance.

    Sandy Lioupi



    ------------------------------
    Sandy Lioupi
    ------------------------------



  • 4.  RE: Logistic regression / categorical variable

    Posted Sat December 19, 2020 01:38 PM
    This makes even less sense to me, but perhaps the groups are misnumbered.

    Here is an example where cases from group 3 are redistributed randomly between groups 1 and 2.

    do if group eq 3.
    do if rv.uniform(0,1) gt .5.
    compute group = 1.
    else. 
    compute group = 2.
    end if.
    end if.

    --





  • 5.  RE: Logistic regression / categorical variable

    Posted Sat December 19, 2020 01:55 PM

    Ok, I see. I might not explain this as I wanted to. Sorry for that.

    I want the new two groups (the new categorical variable) to include: A group-> the N=127 of the 3rd group (so, the original 3rd group)

    and

    B group-> a sample of 127cases randomly selected from the 1st and 2nd groups.



    ------------------------------
    Sandy Lioupi
    ------------------------------



  • 6.  RE: Logistic regression / categorical variable

    Posted Mon January 04, 2021 11:18 AM
    Edited by System Test Fri January 20, 2023 04:50 PM
    Your question was how you can transform a variable with 3 groups (1st group: N= 358, 2nd group: N= 419 and 3 group N =127) in two groups which will include the N=127 of the 3rd group and an equal sample of 127 randomly selected from the other 2 groups (1st and 2nd) .

    I would try this...

    set seed=123456.
    do if any(MyOriginalVar,1,2).
    sample 127 from 777.
    end if.
    execute.
    recode MyOriginalVar (3=1) (1,2=2) into BinaryGroup.
    frequencies variables=BinaryGroup.

    ... and use BinaryGroup for LOGISTIC REG.


    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------