Question
3. R programming
3. This problem uses the wblake data set in the alr4 package. This data set includes samples of small mouth bass collected in West Bearskin Lake, Minnesota, in 1991 Interest is in predicting length with age. Complete this problem without using Im( in R (a) Do the regression of length on age, and report the estimates, their standard errors and the estimate of variance. Interpret Bo and (b) Obtain a 900% confidence interval for βί fron the data. Interpret this interval. (c) Obtain a prediction and a 90% prediction interval for a small mouth bass at age 2. Interpret this interval
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a).

library(alr4)
data(wblake)
head(wblake)
To fit this model,

Y = eta_0+ eta_1 x +e_1

Length = β0 + β1-Age+ el

Our response varaible (y) is "Length" and predictor variable (x) is "Age"


M1=lm(Length~1+Age,data=wblake)
summary(M1)

Output:

Coefficients:
Estimate Std. Error t value Pr(>|t|)   
(Intercept) 65.5272 3.1974 20.49 <2e-16 ***
Age 30.3239 0.6877 44.09 <2e-16 ***

65.5272. 31=30.3239

seo 3.1974, se(1)0.6877

---------------------------------------------------------------------------------------------------------------------

b).

90% confidence interval for slope (i.e. 61 ) is

tse(B1)  

t^* is the critical t value for n-2 degree of freedom.

Degree od freedom = n-2 = 439-2 = 437 (Total no. of observation in wblake data is 439)

Therefore, critical t value at (α = 0.10) for 437 degree of freedom is calculated in R as:

qt(1-0.10/2,437)

1.65

t^* = 1.65

From (1), we have

31 ± t*se(31)

30.3239 pm 1.65* 0.6877= 30.3239 pm 1.134705= (29.18919, 31.4586)

------------------------------------------------------------------------------------------------------------------------

Add a comment
Know the answer?
Add Answer to:
3. R programming 3. This problem uses the wblake data set in the alr4 package. This...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 3. This problem uses the wblake data set in the alr4 package. This data set includes...

    3. This problem uses the wblake data set in the alr4 package. This data set includes samples of small mouth bass collected in West Bearskin Lake, Minnesota, in 1991. Interest is in predicting length with age. Complete this problem without using Im) in R. (a) Do the regression of length on age, and report the estimates, their standard errors and the estimate of variance. Interpret Bo and B. (b) Obtain a 90% confidence interval for A from the data. Interpret...

  • R programming question. Please use #comments too ! 1. The data set UN11 in the alr4...

    R programming question. Please use #comments too ! 1. The data set UN11 in the alr4 package contains several variables, including ppgdp, per capita gross domestic product in US dollars, and fertility, number of children per woman, from the year 2009-2011. The data are for 199 localities, and we will study the regression of ppgdp on fertility (a) Draw the scatterplot of ppgdp against fertility and describe the relationship between these two variables. Is the trend linear? nD the simple...

  • 2. R programming 2·The data set prostate in the faraway package is froma study on 97...

    2. R programming 2·The data set prostate in the faraway package is froma study on 97 men with prostate cancer who were due to receive a radical prostatectomy We are interest is in predicting lpsa (log prostate specific antigen) with Icavol (log cancer volume). (a) Draw a scatterplot -does a simple linear regression model seem reasonable? (b) Without using the R function Im), compute the values T,Y, Sxx, Syy and Sxy. Com- pute the ordinary least squares estimates of the...

  • 1. The data set UN11 in the alr4 package contains several variables, including ppgdp, per capita...

    1. The data set UN11 in the alr4 package contains several variables, including ppgdp, per capita gross domestic product in US dollars, and fertility, number of children per woman, from the year 2009-2011. The data are for 199 localities, and we will study the regression of ppgdp on fertility. (a) Draw the scatterplot of ppgdp against fertility and describe the relationship between these two variables. Is the trend linear? (b) Replace both variables by their natural logarithms and draw another...

  • 2. The data set prostate in the faraway package is from a study on 97 men...

    2. The data set prostate in the faraway package is from a study on 97 men with prostate cancer who were due to receive a radical prostatectomy. We are interest is in predicting lpsa (log prostate specific antigen) with lcavol (log cancer volume). (a) Draw a scatterplot - does a simple linear regression model seem reasonable? (b) Without using the R function Im(0, compute the values , Y,Sxx, Syy and Sxy. Com pute the ordinary least squares estimates of the...

  • Exercise 2. [Data analysis, requires R] For this questions use the bac data set from the...

    Exercise 2. [Data analysis, requires R] For this questions use the bac data set from the openintro library. To access this data set first install the package using install.packages ("openintro") (this only needs to be done once). Then load the pack- age into R with the command library(openintro). You can read about this data set in the help menu by entering the command ?openintro or help(openintro). Many people believe that gender, weight, drinking habits, and many other factors are much...

  • R Programming Language This question uses the lattice package. Show the code you used to generate...

    R Programming Language This question uses the lattice package. Show the code you used to generate the graphs. Use the state.region and state.x77 data set (recall typing ?state.x77 into the console will provide a discription of this data set). Question 1a Investigate the population density of USA states within the four regions: Northeast, South, North Central and West. Observe the graph of State Population as a Function of Area. Create Figure 1. Question 1b There is one state in the...

  • 3. (40 points) Use the graph, an output of the least squares prediction equation for the starting salary data (in thous...

    3. (40 points) Use the graph, an output of the least squares prediction equation for the starting salary data (in thousands of dollars) given a graduated student's cumulative GPA, and the table of sampled data below to do the following Student ID GPA(x) 3.26 Starting Salary (y) 33.8 2.60 29.8 3.35 33.5 2.86 30.4 3.82 36.4 2.21 27.6 3.47 35.3 Regression Plot Y= 14.8156 + 5.70657x R-Sq 0.977 寸 853 4.0 2.0 2.5 3.0 3.5 GPA (a) Identify and interpret...

  • Please use RStudio, thanks! 3. This problem uses the prostate data set in the faraway package....

    Please use RStudio, thanks! 3. This problem uses the prostate data set in the faraway package. (a) Plot lpsa against lcavol. Use the R function lm() to fit the regressions of lpsa on lcavol and lcavol on lpsa. (b) Display both regression lines on the plot. At what point do the two lines intersetct? Give a brief explanation.

  • Using R code: A researcher collects data on the relationship between the amount of daily exercise...

    Using R code: A researcher collects data on the relationship between the amount of daily exercise a person gets and their percent of body fat. She is trying to see if exercise (X) can predict percentage of body fat (Y). The following data were recorded: Individual 1 2 3 4 5 Daily Exercise (min) (X) 10 18 26 33 44 % Fat  (Y) 30 25 18 17 14 a. Draw a scatterplot that represents this data set with linear and lowess...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT