When i try to work out the mean composite score for 3 variables, I get the exact same answer on every row. I am really new to R so if you know the answer, or have an idea, can you try to explain it simply please?
data <- data %>%
group_by(ID) %>%
mutate(attract_comp = mean(c(QUESTION_1, QUESTION_2, QUESTION_3), na.rm = T)) %>%
ungroup()
That's the code I was using and I was trying to get a composite score for QUESTION_1, QUESTION_2 & QUESTION_3 which are the titles for 3 separate columns in my data which kinda looks like: this. Attract_comp is the problem. (ignore opinion_comp).