BBy Bot
Jun 09'24

Exercise

When we have pairs of data [math](x_i,y_i)[/math] that are outcomes of the pairs of dependent random variables [math]X[/math], [math]Y[/math] we can estimate the coorelation coefficient [math]\rho[/math] by

[[math]] \bar r = \frac {\sum_i (x_i - \bar x)(y_i - \bar y)}{(n - 1)s_Xs_Y}\ , [[/math]]

where [math]\bar x[/math] and [math]\bar y[/math] are the sample means for [math]X[/math] and [math]Y[/math], respectively, and [math]s_X[/math] and [math]s_Y[/math] are the sample standard deviations for [math]X[/math] and [math]Y[/math] (see Exercise). Write a program to compute the sample means, variances, and correlation for such dependent data. Use your program to compute these quantities for Galton's data on heights of parents and children given in Appendix B.

Plot the equal density ellipses as defined in Exercise for [math]r = 4[/math], 6, and 8, and on the same graph print the values that appear in the table at the appropriate points. For example, print 12 at the point [math](70.5,68.2)[/math], indicating that there were 12 cases where the parent's height was 70.5 and the child's was 68.12. See if Galton's data is consistent with the equal density ellipses.