Use the R script toanswer the following questions: (write down your answers in the Rscript with ##)
(1). ImportFarmSize.csv to Rstudio. Use the correct function to build a linearregression model predicting the average size of a farm by thenumber of farms; Give the model a name (e.g. FarmSize_Model). Callthe model name to inspect the intercept and slope of the regressionmodel. Verify the answers in your manual calculation.
(2). Use the correctfunction to generate the residuals for the 12 examples in thedataset from the model. Create a residual plot, with x axis asindependent variable and y axis as residual.
(3). Use the correctfunction to inspect SSE, Se and r². Write down the values for thesemeasures. Verify the answers in your manual calculation.
(4). Use the correctfunction to inspect slope statistic testing result. What is the tvalue for the slope statistic testing? What is the p value? What isthe 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 |