Added function to average sleep analysis