12.3 Linear Regression
Lab 12.3.1
The number of years (age) x and prices y, for 10 cars is listed below. Compute the correlation coefficient (r-value), estimated slope and y-intercept of the regression line and the p-value for testing the significance of correlation.
| x | 1 | 0 | 3 | 5 | 14 | 7 | 4 | 16 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| y | 17000 | 20000 | 15000 | 10000 | 5000 | 9000 | 10000 | 2000 | 8000 | 9000 |
Adapted from Python for Introductory Statistics: Student's Lab Workbook, by Simon Aman (Truman College, City Colleges of Chicago), licensed under CC BY 4.0. Changes were made: reformatted as an accessible XYZ web edition with live in-browser code cells. License: CC-BY-4.0.