How to Save Predicted (or manually generated) Values into the Original Data?

The function augment will only work if you directly provide it the lmer model object as an argument. In your case, it probably makes most sense to just add the variable Tps_MLM_op1 to your original data set using more traditional methods like dplyr::mutate(). For example, replace the augment() code with:

M <- mutate(M, Tps_MLM_op1)
write_dta(M, 'M.dta')
3 Likes