Move data analysis to a script file