Closed spsanderson closed 7 months ago
Need to add a plotting function for the extract_regression_residuals()
extract_regression_residuals()
Example code and output:
resid_tbl <- extract_regression_residuals(frt_tbl, TRUE) resid_tbl |> map(\(x) x |> group_by(name) |> mutate(x = row_number()) |> ungroup() |> mutate(plot_group = ifelse(name == ".resid", "Residuals", "Actual and Predictions")) |> ggplot(aes(x = x, y = value, group = name, color = name)) + geom_line() + theme_minimal() + facet_wrap(~ plot_group, ncol = 1, scales = "free") + labs( x = "", y = "Value", title = "Actual, Predicted, and Residual Values by Model Type", subtitle = x$.model_type[1], color = "Data Type" ) )
This needs to handle if the data is in long format or wide format
Need to add a plotting function for the
extract_regression_residuals()
Example code and output: