I have a dataset with 5 columns: batch ID, product, parameter, predicted, and actual. I am trying to output a summary table with the Pearson correlation between predicted and actual grouped by product and parameter. I created a workflow that attempts to do this by deriving a list of unique products and parameters, then filtering the raw data to a particular combination of those two variables, then calculating the Pearson correlation and joining it all together into a single row at the end.
I would like to loop through all of the other possible product + parameter combinations and append the resulting correlation values to the table as well. I tried creating a macro to accomplish this but I'm having a hard time getting the desired result. I have attached the original workflow with sample data, any pointers on how to macro-ize it would be greatly appreciated!