Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to place different categorical variables in one variable?

    Hi everyone

    I am new in Stata. So, sorry about my stupid question

    I run ordınal logistic regression in Stata. And 1 of the my ındependent variable is 'Depression level'.
    But there are 8 different questıon ın the codebook to measure depression level
    For example: variable Q1703A1 is ' I feel sad' and response data are categorical like: 1 Never
    2 Sometimes
    3 Always
    and Q1703A2 is ' I cry' and response data is again 1 Never
    2 Sometimes
    3 Always
    So, there are 8 variables to measure depression pattern and I want to use all of them as 1 variable to put in a logistic regression.
    I wil run the regression then ologit lifesatisfaction depression age etc..

    Anyone know how I can do this?

    Thanks in advance

  • #2
    Use the eight ordered-categorical variables as indicators for a latent factor, Depression, and then use that latent factor as a predictor in a second equation for life satisfaction. Something like
    Code:
    gsem (feel_sad cry [other six indicators of depression] <-Depression, family(ordinal) link(logit)) ///
        (life_satisfaction <- Depression age [etc.], family(ordinal) link(logit))
    See the help file and user's manual for gsem for further details.

    Comment


    • #3
      Oh . I will try this. Thank you so much

      Comment


      • #4
        I like Joseph's approach but it is pretty high tech, and wouldn't have even been possible before gsem came along in Stata 13. A more primitive approach from the past might have involved using the alpha command, possibly dichotomizing the variables first (e.g. Never vs some, or always vs not always). I'm just a little leery of having a newcomer to Stata start with gsem.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://academicweb.nd.edu/~rwilliam/

        Comment


        • #5
          There are many well-developed, well-studied short screening scales for depression that have known operating characteristics relative to a DSM-3 or DSM-4 diagnosis. Perhaps you are using one of those? If so, the scoring algorithm will have been published, and you should follow that method. If you are using a "homebrew" instrument, then, I would agree with Richard Williams' advice.

          I hope, though, that you are not using a homebrew when there are so many well-respected scales out there: Spitzer PHQ, Beck Depression Inventory, and CES-D to name just three.

          Comment


          • #6
            Dear Richard
            Could you please more specify alpha command? I mean, how I can run this command
            and Dear Clyde
            Thank you for your suggestions but I did not prefer to use this simple test. Instead, the data set that I have used implied these weak questions and I will just analyse them.

            Comment


            • #7
              You'd do something like alpha Q1703A1 Q1703A2 . . . Q1703A8, std generate(depression), and then ologit life_satisfaction c.(depression age).

              I understand and agree with Richard's and Clyde's concerns about your using gsem, and I can appreciate that it would be challenging to you trying to tackle SEM based upon a perusal of a software package's user's manual. But, if your research project and its questions entail what it looks like they do based upon your original post, then you'll eventually have to get your feet wet with SEM and what it can offer.

              Comment


              • #8
                Dear Joseph

                I did the alpha command as you said (alpha Q1703A1 Q1703A2 Q1703A3 Q1703A4 Q1703A5 Q1703A6 Q1703A7 Q1703A8, std generate(depression) ) but codebook depression gave me the mean which is useless to me. Instead I want to my gathered variable looks like the same ( Freq. Numeric Label ) as the for example Q1703A1.
                1 -9 Decline to Answer
                9 -8 Not Sure
                1236 1 Rarely or None of the Time
                157 2 Some or Little of the Time
                61 3 Occasionally or a Moderate Amount of Time
                36 4 Most or All of the Time

                The problem is even I have tried the comman alpha, or egen group = varlist : I couldn t get the Depression variable with category numerics (-9 , -8, 1, 2, 3, 4) and their label.

                Comment


                • #9
                  For a brief overview of the alpha command, see http://www3.nd.edu/~rwilliam/xsoc63993/l23.pdf .

                  If you just added the 8 items together, the scores would range from 8 to 32, plus whatever impact missing data would have. You are trying to reduce that to only 6 categories. If that is what you really really want, then you would need to do some sort of recoding to collapse categories together. For example, suppose that on 5 items they said always and on 3 they said never. Do you want that coded as most of the time, or a moderate amount of time, or what? Usually, when you create a scale from multiple items, you do not collapse like that, but if that is what you want to do you have to decide how you want to collapse things.
                  -------------------------------------------
                  Richard Williams, Notre Dame Dept of Sociology
                  StataNow Version: 19.5 MP (2 processor)

                  EMAIL: [email protected]
                  WWW: https://academicweb.nd.edu/~rwilliam/

                  Comment


                  • #10
                    I did :

                    alpha Q1703A1 Q1703A2 Q1703A3 Q1703A4 Q1703A5 Q1703A6 ///
                    Q1703A7 Q1703A8 ,generate(dep)

                    tab dep

                    recode dep(-9/.875 = 0) (1/2.875 = 1) (3/3.875 = 2) (4 = 3)
                    drop if dep == 0

                    and the variable seems logical.

                    Thank you to Richard, Joseph and Clyde: your suggestions were great.

                    Best

                    Comment


                    • #11
                      It sounds like you are still treating -9 and -8 as non-missing values, and that could screw up your scaling, e.g. 7 always and 1 decline to answer could average out to a rarely, which is probably not what you want. I would first recode -9 and -8 to missing for each variable and then run alpha.
                      -------------------------------------------
                      Richard Williams, Notre Dame Dept of Sociology
                      StataNow Version: 19.5 MP (2 processor)

                      EMAIL: [email protected]
                      WWW: https://academicweb.nd.edu/~rwilliam/

                      Comment


                      • #12
                        Also, you should check to see whether alpha actually thought this was a good scale. If the Cronbach's alpha was very low, you may wish to stick with the original items. Or, it may be that one or more of the items in the scale should be dropped. The handout I linked to earlier discusses issues like that.
                        -------------------------------------------
                        Richard Williams, Notre Dame Dept of Sociology
                        StataNow Version: 19.5 MP (2 processor)

                        EMAIL: [email protected]
                        WWW: https://academicweb.nd.edu/~rwilliam/

                        Comment


                        • #13
                          Oh, I am really grateful to you. I did:
                          replace dep = .a if dep ==-9
                          replace dep = .b if dep ==-8

                          So, after that, should I drop these missing values before ologit or it is not a problem if they stay?
                          Last edited by laxmsb; 19 Jun 2014, 09:57.

                          Comment


                          • #14
                            I think you need to do this a step earlier in the analysis, with the variables that are being used to construct your scale. Otherwise, if, say, you had 7 always (each coded 4) and one missing (coded -9) the scores would sum to 19 and the average score would be 2.375, which would then cause the scale to be recoded as 1. I am sure that is not what you want. Your coding would only work when all the scores for the 8 variables for a person were -9 or -8.
                            -------------------------------------------
                            Richard Williams, Notre Dame Dept of Sociology
                            StataNow Version: 19.5 MP (2 processor)

                            EMAIL: [email protected]
                            WWW: https://academicweb.nd.edu/~rwilliam/

                            Comment

                            Working...
                            X