I\'d like to compare users in different groups using a loop. I\'ve included a sample dataframe below and one initial attempt (that ends in error). I\'d like to know how to i