I'm trying to find the quartiles for a variable in my data set, then create a new variable that takes different values depending on the quartile. 4 if the percentage for var1 is greater than the third quartile 3 if the percentage for var1 is between the median & the third quartile 2 if the percentage for var1 is between the first quartile & the median 1 if the percentage for var1 is lower than the first quartile . ( missing value) if the percentage is not given Format the new_var to name the groups “high”, “med-high”, “med-low”, and “low”, respectively. Add a label to the variable as well. my data looks like this: data mydata; input var1 income location percentage; 1 500 ny 100% 2 400 nj 90% 3 400 ma 80% 4 800 va 80% 5 500 ca 75% 6 600 ma 70% 7 900 wv 60% 8 1000 ny 50% 9 100 pa 40% 10 760 wy 20%
... View more