Use the R script to answer the following questions: (write downyour answers in the R script with ##)
(1). Import FarmSize.csv to Rstudio. Use the correct function tobuild a linear regression model predicting the average size of afarm by the number of farms; Give the model a name (e.g.FarmSize_Model). Call the model name to inspect the intercept andslope of the regression model. Verify the answers in your manualcalculation.
(2). Use the correct function to generate the residuals for the12 examples in the dataset from the model. Create a residual plot,with x axis as independent variable and y axis as residual.
(3). Use the correct function to inspect SSE, Se and r². Writedown the values for these measures. Verify the answers in yourmanual calculation.
(4). Use the correct function to inspect slope statistic testingresult. What is the t value for the slope statistic testing? Whatis the p value? What is the statistical decision?
Year | NumberofFarms | AverageSize |
1950 | 5.65 | 213 |
1955 | 4.65 | 258 |
1960 | 3.96 | 297 |
1965 | 3.36 | 340 |
1970 | 2.95 | 374 |
1975 | 2.52 | 420 |
1980 | 2.44 | 426 |
1985 | 2.29 | 441 |
1990 | 2.15 | 460 |
1995 | 2.07 | 469 |
2000 | 2.17 | 434 |
2005 | 2.1 | 444 |