I perform linear regression on different groups (held in column grp) using weights listed down in column wght. This is working just fine.
by_time_frame <- group_by(df, grp)
weighted_model <- do(by_time_frame, tidy(lm(y~x, weights=wght, data=.)))
However, I am not able to plot the (weighted) regression line for each group on the scatter plots:
xyplot(y ~ x | grp, data=df, main='Original Data'),
       panel = function(x, y) {
           panel.xyplot(x, y)
           panel.abline(summary(weighted_model))
           }
       )

 
     
    