I've a data frame with the variables question_ID and estimate with 210 questions asked to 32 people (so 6720 obs.). I want to calculate the log10 for each estimate and subtract the median of the logs for each question.
E.g. for question 1: Sum(log(Estimates1)-median1)/32, for question 2: Sum(log(Estimates2)-median2)/32 and so on till 210. So that at the end I hopefully have 210 values for each question.
So far I calculated the median for each question:
m <- data %>% group_by(question_ID) %>% summarize(m=median(log10(estimate)))
I'm looking for an elegant solution where I don't need to come up with 210 subsets. Any ideas?
Thanks in advance!