Dear all,
I have a question about something that seems relatively easy to do, but I can't figure out for some reason.
For my research I need to generate a variable which should equal: var 1 / mean(var 2). However, the mean(var2) should only consist of those values which belong to a specific group. Both variables have been sorted into 9 categories. So for example, in the following table:
I would ideally divide X / mean (Y2 & Y3).
Is there anyone who know an efficient fix for this issue?
Thank you for your consideration!
Best regards,
Thibault
I have a question about something that seems relatively easy to do, but I can't figure out for some reason.
For my research I need to generate a variable which should equal: var 1 / mean(var 2). However, the mean(var2) should only consist of those values which belong to a specific group. Both variables have been sorted into 9 categories. So for example, in the following table:
Var1 | Cat1 | Var 2 | Cat 2 |
X | 3 | Y1 | 2 |
Y2 | 3 | ||
Y3 | 3 | ||
Y4 | 1 |
Is there anyone who know an efficient fix for this issue?
Thank you for your consideration!
Best regards,
Thibault
Comment