r code used to run predictive models