compile_results function

Run the analysis and compile the results.