# Reading the data into R:my.datafile <- tempfile()cat(file=my.datafile, \" 71 15 74 19 70 11 71 15 69 12 73 17 72 15 75 19 72 16 74 18 71 13 72 15 73 17 72 16 71 15 75 20 71 15 75 19 78 22 79 23 72 16 75 20 76 21 74 19 70 13 \", sep=\" \")options(scipen=999) # suppressing scientific notationsimpbasketball <- read.table(my.datafile, header=FALSE, col.names=c(\"height\", \"goals\"))
COMPUTER CALCULATIONS:
I need to know how to code in R for the solutions, notby hand.
2. Look at the data in Table 7.18 on page 368 of the textbook.These data are also
given in the SAS code labeled “SAS_basketball_goal_data†and Rcode labeled basketball goal data .
The dependent variable is goals and the independent variable isheight of basketball players.
Complete a SAS /R program and answer the following questionsabout the data set:
(a) Does a scatter plot indicate a linear relationship betweenthe two variables?
Is there anything disconcerting about the scatter plot?Explain.
(b) Fit the least-squares regression line (using SAS / R) andinterpret the estimated slope
in the context of this data set. Does it make sense to interpretthe estimated intercept? Explain.
(c) For these data, what is the unbiased estimate of the errorvariance? (Give a number.)
(d) Using the SAS / R output, test the hypothesis that the trueslope of the regression line
is zero (as opposed to nonzero). State the appropriate null andalternative hypotheses,
give the value of the test statistic and give the appropriateP-value. (Use significance
level of 0.05.) Explain what this means in terms of therelationship between the two
variables.
(e) Using SAS / R, find a 95% confidence interval for the meanbasketball goal for
a player with a height of 77 inches. In addition find a 95%prediction interval for
basketball goal for a player with a height of 77 inches.