Split a data frame or matrix into subsets based on a particular categorical variable
split_mat(obj, by)
is a data frame or matrix to be split into subsets, divided by the categorical variable
is a character-string that specifies the columns that need to be subsetted
A list containing the subsetted data sets. The names of the list corresponds to the value of the subsetted list