calculate mg column stats