I have data which I regularly run regressions on. Each \"chunk\" of data gets fit a different regression. Each state, for example, might have a different function that expla
You need to use mdply to supply both the model and the data to each function call:
mdply
dataList <- dlply(newData, "state") preds <- mdply(cbind(mod = modelList, df = dataList), function(mod, df) { mutate(df, pred = predict(mod, newdata = df)) })