Announcement

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

  • Means per multiple variables and multiple observations, with missing values

    Dear Statalist,

    I am very new to STATA and Statalist, so please forgive me if in some way my question is unclear.


    I am using STATA17 and want to calculate the means, standard deviations and p-values of a dataset combining multiple variables and multiple observations with missing values in between.

    I have conducted a survey, for which participants were asked to rate achievement, on a 5-item Likert scale with "0" as the option for "not applicable", for 47 criteria (my variables). I have recoded for "0" to be missing values and now I would like to calculate means for subgroups, combining the multiple variables. I have familiarized myself with
    Code:
    mean()
    and
    Code:
    rmean()
    and
    Code:
    rowtotal()
    But these will only allow for either the rows or columns. How can I get a mean (with weighted missing values) for both rows and columns combined in STATA? I can do it by hand (or calculator) but would like to get the additional information on standard deviation and p-value.

    Thank you in advance for your advise.

    Kind regards,
    Mink Sjamsoedin

  • #2
    You could copy the data to Mata and there take a mean over a matrix. Otherwise, a mean over observations and over variables needs to be calculated in two steps, say by calculating a row mean and then a mean over the row means.

    Treating not applicable as 0 is puzzling to me, but it's your data and your problem and your field.

    Comment


    • #3
      Dear Nick,

      Thank you for your reply. I am glad to hear that there is no other way than to do it in two steps when using STATA, now I can stop looking for a solution there. I will look into Mata then.
      In reply to your remark on 0 for not applicable, this was the only way it could be exported from the online survey service I used, unfortunately.

      Comment


      • #4
        But now you are in Stata, you can replace 0s by missings. See

        Code:
        help mvdecode

        Comment


        • #5
          Sorry, I should have mentioned specifically that I have already changed the 0 into missing values

          Comment

          Working...
          X