Announcement

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

  • Set pecking order

    Hi,

    Im working with 10 variables and I want to generate a new variable that takes the average value of 1-3 (maximum) variable/s from the 10variables (condition on within the 10variables there are variable/s have a value greater than 0.1, if there are more than 3 variables have a value greater than 0.1 - select 3variables with the highest value then take the average )

    All helps appreciated

    Cheers,
    Tom

  • #2
    Including programming time, for me the fastest approach would be to create a new dataset containing the 10 variables and the identifier, then reshape that data from wide to long, then use all the familiar tools to sort, delete, and collapse the data, and then merge the result, with just the identifier and the average, one observation per identifier, back into the original data.

    Comment


    • #3
      Thanks for the help William

      Comment

      Working...
      X