Make choice of summary statistics a function parameter