Obtaining absolute deviation from mean for two sets of scores
问题 To obtain absolute deviation from the mean for two groups of scores, I usually need to write long codes in R such as the ones shown below. Question I was wondering if it might be possible in BASE R to somehow Vectorize the mad() function so that the absolute deviation from the mean scores for each group of scores in the example I'm showing below could be obtained using that Vectorized version of mad() ? Any other workable ideas are highly appreciated? set.seed(0) y = as.vector(unlist(mapply