Compute means and output to file.