check_formula function

Generic S3 method for checking if the formula is valid for the specified model