Linear Regression
You will find some data in linregdata.csv. The file is a .csv (comma-separated-values) file containing three columns: Income (dollars), Age (years) and Education (years). There are 10 observations (rows).
Your task is to estimate a linear model that predicts Income (Y) using Age (X).
The model will be of the form:
\hat{Y} = \beta_{0} + \beta_{1} X
- Produce a scatterplot of income as a function of age for the 10 observations in the data file.
- Estimate \beta_{0} and \beta_{1} in the equation above.
- Plot a line overtop of the scatterplot above that represents the linear regression line.
- Report the values of \beta_{0} and \beta_{1}
- Using the linear regression equation, predict Income for someone who is 39 years old.
Bonus Challenge
Estimate a new model that uses both Age (X_{1}) and Eduction (X_{2}) to predict Income (Y):
\hat{Y} = \beta_{0} + \beta_{1} X_{1} + \beta_{2} X_{2}