Split regress into two functions, one of which post-processes the data using pca