Announcement

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

  • Reverse coding Likert scale responses

    Hi,

    I have a set of 8 questions of which Q1, 2, 4, 6,7 are negative and Q3,5,8 are positive (attached questionnaire) on a scale of 1 (never) to 5 (very often)
    Now I wanted to create a categorical (Yes No) variable for the entire questionnaire and for positive and negative subscales individually.
    I used the code *for all negative questions

    foreach var in PAQ1 PAQ2 PAQ4 PAQ6 PAQ7 {
    replace `var' = 6 - `var'
    }


    In the next step, I wanted to check the impact of negative and positive responses on the outcome separately also the impact of overall responses.
    Is this reverse coding is correct? because after reverse coding, all labels are similar but not values and I am clueless how to create categorical variables combining all responses.
    Q1 5 Very often 4 3 2 1 never
    Q2 5 Very often 4 3 2 1 never
    Q3 1 Very often 2 3 4 5 never
    Q4 5 Very often 4 3 2 1 never
    Q5 1 Very often 2 3 4 5 never
    Q6 5 Very often 4 3 2 1 never
    Q7 5 Very often 4 3 2 1 never
    Q8 1 Very often 2 3 4 5 never
    I think I am missing something here although it looks simple

    Can someone please explain me how to understand this and generate a categorical variable for combined responses. That would be very helpful

    Thank you
    Attached Files

  • #2
    The labels won't change until you change them.

    recode will alter the labels.

    Code:
    foreach var in PAQ1 PAQ2 PAQ4 PAQ6 PAQ7 {
        recode `var' = (1 = 5) (2 = 4) (3 = 3) (4 = 2) (5 = 1)
    }

    Comment


    • #3
      From the help for recode (with emphasis added):

      generate(newvar) specifies the names of the variables that will contain the transformed variables. into() is a synonym for generate(). Values outside the range implied by if or in are set to missing (.), unless the copyrest option is specified.

      If generate() is not specified, the input variables are overwritten; values outside the if or in range are not modified. Overwriting variables is dangerous (you cannot undo changes, value labels may be wrong, etc.), so we strongly recommend specifying generate().
      --
      Bruce Weaver
      Email: [email protected]
      Version: Stata/MP 18.5 (Windows)

      Comment


      • #4
        Originally posted by Pallavi Ch View Post
        . . . I wanted to create a categorical (Yes No) variable for the entire questionnaire and for positive and negative subscales individually.

        Can someone please explain me how to . . . generate a categorical variable for combined responses.
        You don't really need to mess with your dataset or recode anything in order to achieve your goal here. See below for a suggestion. It creates categorical yes-no variables for the entire scale and for the two subscales individually. (Start at the "Begin here" comment; the stuff above is just to create an illustrative dataset inasmuch as you didn't attach yours.)
        Code:
        version 18.0
        
        clear *
        
        // seedem
        set seed 1439300608
        
        tempname Corr
        matrix define `Corr' = J(8, 8, 0.5) + I(8) * 0.5
        
        mata: st_local("varlist", invtokens(("lat" :+ strofreal(1::8))'))
        
        quietly drawnorm `varlist', double corr(`Corr') n(250)
        
        forvalues i = 1/8 {
            generate byte PAQ`i' = 1
        
            /* Q1, 2, 4, 6,7 are negative and Q3,5,8 are positive */
            if inlist(`i', 1, 2, 4, 6, 7) quietly replace lat`i' = -lat`i'
        
            forvalues cut = 1/5 {
                quietly replace PAQ`i' = PAQ`i' + 1 if normal(lat`i') > `cut' / 6
            }
        }
        
        *
        * Begin here
        *
        set type double
        
        /* "create a categorical (Yes No) variable for the entire questionnaire" */
        alpha PAQ?, reverse(PAQ1 PAQ2 PAQ4 PAQ6 PAQ7) generate(paq)
        summarize paq, meanonly
        generate byte all = paq > r(mean)
        
        /* "and for positive . . ."  */
        alpha PAQ3 PAQ5 PAQ8, generate(q358)
        summarize q358, meanonly
        generate byte pos = q358 > r(mean)
        
        /* ". . . and negative subscales individually" */
        alpha PAQ1 PAQ2 PAQ4 PAQ6 PAQ7, generate(q12467)
        summarize q12467, meanonly
        generate byte neg = q12467 <= r(mean)
        
        label define NY 0 No 1 Yes
        label values all neg pos NY
        
        exit
        alpha creates a simple sumscore scale; if you want something more sophisticated (allowing for different factor-loading magnitudes), then take a look at gsem with an ordered-categorical distribution family and link function. Again, you will not need to manually reverse the scales with any of your questionnaire items; gsem will likewise take care of that for you.

        Comment


        • #5
          Dear @George Ford @Bruce Weaver
          Thank you for your responses.
          I have already tried the code that you have suggested first time by generating new variable. However, I was not able to group these responses into yes no because after reverse coding only label has changed but not the rating.





          Comment


          • #6
            Dear Joseph Conveney,

            firstly, thank you for your help

            concept is clear with generating positive and negative questions individually. Responses were grouped into quartiles now.

            My question is, at first I used alpha command for all questions and STATA automatically detected

            #code
            alpha PAQ8_paq801 PAQ8_paq802 PAQ8_paq803 PAQ8_paq804 PAQ8_paq805 PAQ8_paq806 PAQ8_paq807 PAQ8_paq808

            #output

            Test scale = mean(unstandardized items)
            Reversed items: PAQ8_paq803 PAQ8_paq805 PAQ8_paq808

            Average interitem covariance: .2054056
            Number of items in the scale: 8
            Scale reliability coefficient: 0.7064

            I noted reversed items here for positive questions. Does it happen automatically?

            In this scenario, do I need to reverse code negative questions ?

            could you please clarify?

            Thank you





            Comment


            • #7
              Originally posted by Pallavi Ch View Post
              I noted reversed items here for positive questions. Does it happen automatically?
              Yes.

              Based upon my experience with its behavior, when the user does not specify which items to reverse the sense of, the command automatically reverses the sense of those in the minority of items to match the sense of those in the majority of items.

              In your case, the majority are negative and so it's the positive-sense minority of items whose sense gets reversed automatically by alpha.

              In this scenario, do I need to reverse code negative questions ?
              No.

              You can reverse the sense of the negative items when invoking the alpha command via its reverse() option. But If you choose not to, then you simply reverse the sense of the resulting sumscore (as I did above in #4).

              Comment


              • #8
                Alright. Thanks much for your clarification.

                Comment

                Working...
                X