Added function for comparing error messages

Let clustered linear and logistic use this function