Announcement

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

  • Calculating Cronbach's alpha in STATA does not return a result, only "."

    Dear Statalist

    I have a dataset of responses to a questionnaire. I need to calculate Cronbach's alpha using the alpha command in STATA.

    I get the right output, when I run the command on the entire data set, e.g.

    alpha sgi_s1 sgi_s2 sgi_s3 sgi_s4 sgi_s5 sgi_s6 ///
    sgi_a1 sgi_a2 sgi_a3 sgi_a4 sgi_a5 sgi_a6 ///
    sgi_a7 sgi_a8 sgi_a9 sgi_a10 ///
    sgi_i1 sgi_i2 sgi_i3 sgi_i4 sgi_i5 sgi_i6 ///
    sgi_i7 sgi_i8 sgi_i9 sgi_i10 sgi_i11 sgi_i12 ///
    sgi_i13 sgi_i14 sgi_i15 sgi_i16 sgi_i17 sgi_i18 ///
    if event==1, std item label


    When I divide the participants into three groups, I sometimes get the right output, but othertimes i only get the item-test and item-rest corr., while the interitem corr. and alpha are simply returned as ".", e.g.

    alpha sgi_s1 sgi_s2 sgi_s3 sgi_s4 sgi_s5 sgi_s6 ///
    sgi_a1 sgi_a2 sgi_a3 sgi_a4 sgi_a5 sgi_a6 ///
    sgi_a7 sgi_a8 sgi_a9 sgi_a10 ///
    sgi_i1 sgi_i2 sgi_i3 sgi_i4 sgi_i5 sgi_i6 ///
    sgi_i7 sgi_i8 sgi_i9 sgi_i10 sgi_i11 sgi_i12 ///
    sgi_i13 sgi_i14 sgi_i15 sgi_i16 sgi_i17 sgi_i18 ///
    if event==1 & diaggr==0, std item label



    The problem does not always occur within the same group, so the division into groups should be ok. The number of obs also differ in all calculations. I have run the same commands without problems in another questionnaire, so I guess the problem lies within the responses to the current questionnaire, but I cannot seem to find the problem/cause.

    Can anyone explain the problem to me? And is there a solution?

    Thanks alot!

    Thomas

  • #2
    I have found out that a certain question is the problem. This question has around 50% missing answers, and if it is removed, STATA returns the results as requested.

    However, the number of missing answers is also high in the groups where the alpha command runs just fine.

    So I am still left wondering what the problem really is?

    Comment


    • #3
      Stata will ignore any observation with at least one missing value on your list of variables. My guess is that with your problematic variable included there is one observation left. Since Cronbach's alpha is based on correlations, it needs at least two observations in order to be able to give you a number, and thus it returns a missing value. I suspect one observation is left and not zero, because Stata tends to return a different error message when that happens.
      ---------------------------------
      Maarten L. Buis
      University of Konstanz
      Department of history and sociology
      box 40
      78457 Konstanz
      Germany
      http://www.maartenbuis.nl
      ---------------------------------

      Comment


      • #4
        Dear Marteen

        Thank you for your answer.

        I have 150 observations in total and around 50 in each subgroup.

        However, STATA return a result with 54% (27/50) missing answers in the problematic variable in one subgroup, while the result is missing with 47% missing answers (24/51) in another subgroup.

        So there should be enough observations to calculate correlations.

        Comment


        • #5
          Your are specifying a lot of variables in your alpha command, and all of these variables must be observed for an observation to be included. One missing value on any of these is enough for that entire observation to be excluded from all computations inside alpha. So I still think you don't have enough fully observed observations.
          ---------------------------------
          Maarten L. Buis
          University of Konstanz
          Department of history and sociology
          box 40
          78457 Konstanz
          Germany
          http://www.maartenbuis.nl
          ---------------------------------

          Comment


          • #6
            Maarten Buis gives good advice as always.

            Your expectation, or your hope, that there should be enough observations is contradicted by the failure to see a result here.

            You have a bunch of variables

            Code:
            sgi_s1 sgi_s2 sgi_s3 sgi_s4 sgi_s5 sgi_s6 sgi_a1 sgi_a2 sgi_a3 sgi_a4 sgi_a5 sgi_a6 sgi_a7 sgi_a8 sgi_a9 sgi_a10 sgi_i1 sgi_i2 sgi_i3 sgi_i4 sgi_i5 sgi_i6 sgi_i7 sgi_i8 sgi_i9 sgi_i10 sgi_i11 sgi_i12 sgi_i13 sgi_i14 sgi_i15 sgi_i16 sgi_i17 sgi_i18
            I would count non-missings by feeding that list to

            Code:
            egen available = rownonmiss()
            (NB the variable names belong in between the parentheses)

            and then show us the results of (e.g.)

            Code:
            tabulate available if event==1 & diaggr==0

            Comment


            • #7
              Thanks for your comments.

              I have run the egen rownonmiss on the varlist of 34 variables. The results are:

              tabulate available if event==1 & diaggr==0

              available | Freq. Percent Cum.
              ------------+-----------------------------------
              0 | 1 1.92 1.92
              30 | 1 1.92 3.85
              32 | 2 3.85 7.69
              33 | 22 42.31 50.00
              34 | 26 50.00 100.00
              ------------+-----------------------------------
              Total | 52 100.00


              . tabulate available if event==1

              available | Freq. Percent Cum.
              ------------+-----------------------------------
              0 | 2 1.33 1.33
              29 | 1 0.67 2.00
              30 | 1 0.67 2.67
              32 | 4 2.67 5.33
              33 | 70 46.67 52.00
              34 | 72 48.00 100.00
              ------------+-----------------------------------
              Total | 150 100.00


              tabulate available if event==1 & diaggr==2

              available | Freq. Percent Cum.
              ------------+-----------------------------------
              29 | 1 2.13 2.13
              33 | 22 46.81 48.94
              34 | 24 51.06 100.00
              ------------+-----------------------------------
              Total | 47 100.00


              Both have missing values (<34) in a number of observations, but the in the first one, alpha is returned as missing, and in the last two, a result is returned for alpha.

              So unfortunately, I am still not quite certain of what the problem is??
              Last edited by Thomas Prior; 02 May 2019, 07:14.

              Comment

              Working...
              X