I have a question about analysing with repeated measures. So i made a model of my dependent variable (S, stands for adjustment, is numeric), my independent variable (populair_friend condition, is factor/categorical) and i added two covariates (gender/geslacht, categorical, and popularity goal, numeric).
So this is my code:
make model of variables
model3 <- lm(final_data$S ~ final_data$populair_vriendfinal_data$pop_doel+ final_data$populair_vriendfinal_data$geslacht, data=final_data)
summary(model3) # show results
res.aov3 <- aov(model3, data = final_data, dv = final_data$S, wid = final_data$participant_ID, within = final_data$populair_vriend)
But now my question is: I want to insert the within grouping already in my model, in stead of in my ancova. Does anybody knows how to do this?