Announcement

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

  • producing new variable based on the mean of three variables

    Hi,

    I would like to calculate the mean of systolic blood pressure based on three observations for each participants, so I have 3 variables and I want to calculate the men for each row to produce new variable. Also, some observations are missing.

    Thank you in advance.

  • #2
    It's either three observations or three variables. Let's guess the first.

    Code:
    egen mean = mean(systolic), by(id)
    will take care of missing values too. If that doesn't help, please show a data example.

    Comment


    • #3
      Thank you very much Nick for your help. I was looking for three variables, but I was able to reach the right command.

      Comment


      • #4
        Code:
         
         egen mean = rowmean(systolic1 systolic2 systolic)

        Comment


        • #5
          Thank you for your help Mr. Nick.

          Comment

          Working...
          X