Data analysis code