functions for getting regression data