Create dummy variable for below or above median within group r
Suppose I have a dataframe like the following: X Y Z 1 b 3 2 a 8 3 a 7 4 c 1 5 b 6 6 a 4 7 a 9 8 b 5 9 a 4 I want to create columns A and B, which are dummy variables for if the value of… Read More Create dummy variable for below or above median within group r