Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This next problem pertains to the “cats” data set within the “MASS” library in R

ID: 3159038 • Letter: T

Question

This next problem pertains to the “cats” data set within the “MASS” library in R.

library(MASS)

head(cats) # look at the cats data

The following are variables in the cats data set:

Bwt = body weight of adult cats in kg

Hwt = heart weight in adult cats g.

Sex = Gender of the cat.

Let Hwt be the response variable (i.e. Y) and let Bwt be the descriptive variable (i.e. X). Answer the following questions using R.

the data for this problem is

Sex Bwt Hwt
1 F 2.0 7.0
2 F 2.0 7.4
3 F 2.0 9.5
4 F 2.1 7.2
5 F 2.1 7.3
6 F 2.1 7.6

a) Using the lm() function in R fit a simple linear regression to this dataset. Based upon the summary of the fitted model what can you conclude from this analysis? Comment on what the summary() function tells you. Is the3 slope significant, what does it mean what other things can you say from the summary() results?

b)Now plot the data along with the least squares regression line and add the along with lines that represent the confidence and prediction bands. There is some hints in R tutorial 3 which will help you out with how to do this. Comment on this graph, what are the differences between the confidence interval lines and the prediction interval lines?

c)Check to see if the model assumptions for the residuals are met for this model by typing the following into R to produce the 4 default residual plots in R.

par(mfrow=c(2,2)) plot(regressionmodel)

Comment on what each plot tells us.

d) Does there seem to be a linear relationship between the Body Weight and Heart Weight in Adult Cats? Your entire analysis should be used to answer this question, this is not a yes or no question!

Explanation / Answer

> Bwt=c(2.0,2.0,2.0,2.1,2.1,2.1)

> Hwt=c(7.0,7.4,9.5,7.2,7.3,7.6)

> lm(Hwt~Bwt)

Call:

lm(formula = Hwt ~ Bwt)

Coefficients:

(Intercept)          Bwt

      19.97        -6.00

> fit=lm(Hwt~Bwt)

> summary(fit)

Call:

lm(formula = Hwt ~ Bwt)

Residuals:

       1        2        3        4        5        6

-0.96667 -0.56667 1.53333 -0.16667 -0.06667 0.23333

Coefficients:

            Estimate Std. Error t value Pr(>|t|)

(Intercept)   19.967     16.089   1.241    0.282

Bwt           -6.000      7.846 -0.765    0.487

Residual standard error: 0.9609 on 4 degrees of freedom

Multiple R-squared: 0.1276,    Adjusted R-squared: -0.09055

F-statistic: 0.5848 on 1 and 4 DF, p-value: 0.487

                                Bwt = 19.967 + (-6.000) Hwt

                    a) Slope of the data is ( -6.000)

                    b) p-value for the slope is 0.487

Since p-value > 0.05 (5% level of significance), it is not significant, which implies there is no significant relationship between independent (Hwt) and dependent variable (Bwt).

                    c) R-squared value from R2 = 12.76 %, which mean the model explain 12.76 % between          

                         dependent and independent variable.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote