Add linear regression functions #555
Add within group constructs