Announcement

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

  • Combining multiple variables into one for a Guttman scale

    Hi all,

    I'm trying to combine the responses of several variables into one like a Guttman scale of sorts. I've been trying to search the internet, but I can't find anything that is working the way I want it to! Basically, I'd like to create a variable that shows if people support abortion with the following three questions. Each question asks if they would support abortion under different circumstances (1=yes and 2=no). I'd like to produce a variable that adds up all the responses so I can get a variable that tells me an overall support or against of abortion with these three questions. How can I do this? I read that I could use the group command, but my stata couldn't find this command! THANK YOU


    . tab abany

    ABORTION IF |
    WOMAN WANTS |
    FOR ANY |
    REASON | Freq. Percent Cum.
    ------------+-----------------------------------
    1 | 547 36.93 36.93
    no | 934 63.07 100.00
    ------------+-----------------------------------
    Total | 1,481 100.00

    . tab abrape

    PREGNANT AS |
    RESULT OF |
    RAPE | Freq. Percent Cum.
    ------------+-----------------------------------
    1 | 1,197 81.21 81.21
    no | 277 18.79 100.00
    ------------+-----------------------------------
    Total | 1,474 100.00

    . tab absingle

    NOT MARRIED | Freq. Percent Cum.
    ------------+-----------------------------------
    1 | 612 41.18 41.18
    no | 874 58.82 100.00
    ------------+-----------------------------------
    Total | 1,486 100.00

  • #2
    this isn't the only way, nor necessarily the best way, to do what you want. But the logic is straightforward, I think looking at the GSS codebook you will be able to follow it:

    Code:
    gen abany2=0 if abany==2
    replace abany2=1 if abany==1
    
    gen abrape2=0 if abrape==2
    replace abrape2=1 if abrape==1
    
    gen absingle2=0 if absingle==2
    replace absingle2=1 if absingle==1
    
    gen totalab=abany2+abrape2+absingle2
    
    tab totalab

    Comment


    • #3
      There are some fairly stringent assumptions that need to hold for Guttman's scaling method. Why not use IRT and/or CTT to estimate the latent mean of support?

      Comment


      • #4
        Originally posted by wbuchanan View Post
        There are some fairly stringent assumptions that need to hold for Guttman's scaling method. Why not use IRT and/or CTT to estimate the latent mean of support?
        If Rachel is just learning Stata, I don't think SEM/IRT/CTT are immediately available. We all have to start from somewhere, and she's just starting out.

        Comment


        • #5
          In that case a sum score is likely to be easier to defend and requires far fewer assumptions than a Guttman scale. She would, however, need to recode the variables so they are binary keyed (e.g., 0 = No, 1 = Yes). In that case the sum scale is a sufficient statistic to identify the underlying trait in the Rasch framework and is much easier for others to understand.

          Comment


          • #6
            Thank you all for the replies! Ben, your code worked great, thank you!

            I am just learning Stata so I'm not really sure about how to use SEM/IRT/CTT yet, but I hope to get there someday

            Comment


            • #7
              Best of luck Rachel. Read the FAQs, and come back for help as needed. A well-formed question based upon the FAQs is most likely to get a good response.

              Comment


              • #8
                Here is a way to do what you want. The index you choose will depend on whether you want the 1's or 2's to be the top category.

                Code:
                cap drop index1 index2
                gen index1=(abany+abrape+absingle)-2
                gen index2=7-(abany+abrape+absingle)
                
                tab index1
                tab index2
                Best,
                Alan

                Comment


                • #9
                  Thank you!

                  Okay, hopefully last question about this. When I used the above code, my N shrank by about 50 and I was wondering if there was a way to correct that and keep more of my data.

                  I think I need to use the egen and rowtotal code, but I keep getting the
                  '=exp not allowed' error.

                  Does anyone know what is wrong with the code below?

                  gen abany2=0 if abany==2
                  replace abany2=1 if abany==1

                  gen abrape2=0 if abrape==2
                  replace abrape2=1 if abrape==1

                  gen absingle2=0 if absingle==2
                  replace absingle2=1 if absingle==1

                  egen totalab=rowtotal(abany2 abrape2 absingle2) = row

                  Comment


                  • #10
                    You probably have missing values, but you can simplify what you're doing now a bit as well:

                    Code:
                    qui: g abany2 = abany == 1
                    qui: g abrape2 = abrape == 1
                    qui: g absingle2 = absingle == 1
                    When you use an expression that evaluates to a true/false condition Stata's default is to return a value of 1 for true and 0 for false.

                    Comment


                    • #11
                      In response to #9

                      I think I need to use the egen and rowtotal code, but I keep getting the
                      '=exp not allowed' error.

                      Does anyone know what is wrong with the code below?

                      ...

                      egen totalab=rowtotal(abany2 abrape2 absingle2) = row
                      The problem is the extraneous "= row" at the end of that last line. Take that out and things should be fine.

                      Comment


                      • #12
                        egen rowtotal() may not be the best approach. Since it treats missing as zero, somebody who answered two out of the three implicitly said "no" to the third, since 0="no". what might work better if you want to preserve those cases is:

                        Code:
                        egen meanab=rowmean(abany2 abrape2 absingle2)
                        gen totalab=3*meanab
                        You'll end up with a few cases with fractions,and need to decide how to deal with them (check out the round() function), but at least you wouldn't be imputing "no" for all missing cases.

                        Comment

                        Working...
                        X