Universit´e Joseph Fourier L2/STA230
TP8: Linear regression
The objective of this lecture is to realize some linear regressions and the associated confidence intervals and tests.
1 Linear regression
We want to realize a linear regression to study if the weight of the baby is linked to the weight or the age of the mother.
1. Open the data “BB.csv”.
2. We study the link between the baby’s weight and the mother’s age.
(a) Which variable is the explaining one ? Which variable is the explained one ? Which one is considered as deterministic ? Which one is considered as random
? We denote X the deterministic and explaining variable and Y the random and explained variable.
(b) Plot the scatter plot of the two variables. Comment (c) Write the equation for the regression line for Y onto X.
(d) Compute the correlation coefficient between X andY. Is there a strong corre- lation ?
(e) Find the coefficients of the regression line.
(f) Plot the regression line on the scatter plot. Comment.
(g) Find the estimated variance of the regression. Comment.
(h) What value would you predict for a 42 year old person ?
3. Now, we study the link between the baby’s weight and the mother’s weight. Proceed exactly as before.