Statistical calculations in graphs