added funtions for splitting and comparing results across groups