Session Ready
Exercise

How does loan purpose affect amount funded?

In the last exercise, we pared the purpose variable down to a more reasonable 4 categories and called it purpose_recode. As a data scientist at Lending Club, we might want to design an experiment where we examine how the loan purpose influences the amount funded, which is the money actually issued to the applicant.

Remember that for an ANOVA test, the null hypothesis will be that all of the mean funded amounts are equal across the levels of purpose_recode. The alternative hypothesis is that at least one level of purpose_recode has a different mean. We will not be sure which, however, without some post hoc analysis, so it will be helpful to know how ANOVA results get stored as an object in R.

Instructions
100 XP
  • Use lm() to look at how the purpose_recode variable affects funded_amnt. Save the model as an object called purpose_recode_model.
  • Usesummary() to examine purpose_recode_model. These are the results of the linear regression.
  • Call anova() on purpose_recode_model. Save as an object called purpose_recode_anova. Print it to the console by typing it.
  • Finally, examine the class of purpose_recode_anova.