I am very new to R, and am looking to send each participant individual feedback of their results in my study. To do so, I believe I need to aggregate the dataset by the participant ID number (please correct me if I am on the wrong track!), however am having trouble doing so. I have attempted to combine their answers on each variable/question using rbind and cbind, and then using aggregate() to present each participant's mean score. This is my first time using the aggregate() function, so I am not sure what I have done incorrectly.
mod_4 <- rbind(model_4_tab$Q_Prior, model_4_tab$Q_Field, model_4_tab$Q_Speciality, model_4_tab$Q_Ability_Evidence, model_4_tab$Q_Ability_Belief, model_4_tab$Q_Opinion, model_4_tab$Q_BackedUp, model_4_tab$Q_Consistency, model_4_tab$Q_Trust_Fair, model_4_tab$Q_Trust_Correct, model_4_tab$Q_Credibility, model_4_tab$Q_Value, model_4_tab$Q_Weight)
mod_4 <- cbind(model_4_tab$Q_Prior, model_4_tab$Q_Field, model_4_tab$Q_Speciality, model_4_tab$Q_Ability_Evidence, model_4_tab$Q_Ability_Belief, model_4_tab$Q_Opinion, model_4_tab$Q_BackedUp, model_4_tab$Q_Consistency, model_4_tab$Q_Trust_Fair, model_4_tab$Q_Trust_Correct, model_4_tab$Q_Credibility, model_4_tab$Q_Value, model_4_tab$Q_Weight)
aggregate(mod_4, by = list(
ID = model_4_tab$ID,
Qs = mod_4),
FUN = mean, INDICES = model_4_tab$ID, simplify = TRUE, drop = FALSE)
Thank you for your help!