Exercise

Income and vegetables

As we saw in a previous exercise, the variable '_VEGESU1' represents the number of vegetable servings respondents reported eating per day.

Let's estimate the slope of the relationship between vegetable consumption and income.

Instructions

100 XP
  • Extract the columns 'INCOME2' and '_VEGESU1' from subset into xs and ys respectively.
  • Compute the simple linear regression of these variables.