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

fitness,body.size 4,6.373546189 3,7.183643324 2,6.164371388 14,8.595280802 5,7.3

ID: 3269684 • Letter: F

Question

fitness,body.size

4,6.373546189

3,7.183643324

2,6.164371388

14,8.595280802

5,7.329507772

2,6.179531616

2,7.487429052

5,7.738324705

8,7.575781352

4,6.694611613

12,8.511781168

6,7.389843236

3,6.378759419

2,4.785300113

3,8.124930918

0,6.955066391

5,6.983809737

3,7.943836211

5,7.821221195

6,7.593901321

12,7.918977372

5,7.782136301

4,7.074564983

1,5.010648304

6,7.619825748

4,6.94387126

4,6.844204493

1,5.529247616

2,6.521849945

5,7.41794156

6,8.358679552

1,6.897212273

1,7.387671612

5,6.946194959

5,5.622940443

4,6.585005437

4,6.605710046

4,6.940686603

11,8.100025372

5,7.763175748

5,6.835476404

4,6.74663832

3,7.696963375

3,7.556663199

4,6.311244305

3,6.292504843

3,7.364581962

7,7.768532925

2,6.887653788

8,7.881107726

T-Mobile LTE 11:13 AM Code at least two functions to examine the data and determine the mean, range and standard deviation of body size. (Spts) a) Run a correlation with each coefficient method to; i) determine if there is a linear relationship between body size and fitness worth evaluating, if so report the value, and ii) plot the correlation with the variable body size on the x axis. (Spts) . b) Conduct a simple linear regression with body size as the explanatory variable and name the results "modelA." (5pts) c) Load the package ggfortify and plot the residuals. Examine and determine if the residuals meet the assumptions of a lineat regression? Why or why not? (5pts) d) Call the results of the linear regression and report the level of significance for the model overall and the coefficient for the explanatory variable as you would for a report or journal article. (5pts) e) Is this a valid model for the data: Why or why not?(Spts) RStudio

Explanation / Answer

data<-read.csv("BODY.csv")
summary(data$body.size)#function to calculate mean ,range and stand devation for body size variable

##    Min. 1st Qu. Median    Mean 3rd Qu.    Max.
##   4.785   6.628   7.129   7.100   7.728   8.595

#b i. correlation
cor(data)

##             fitness body.size
## fitness   1.0000000 0.6068121
## body.size 0.6068121 1.0000000

#The correlation is 60%

#ii. scatterplot to see the linear relationship among the variables
plot(data$body.size,data$fitness)

#there is a slightly weak linear relationship among the variables


#c. linear model
modelA<-lm(body.size~fitness,data=data)


#d.
plot(modelA)#plot residual vs fitted values

#there ar so many outliers indicating the high standard sum error which makes the model unfit

#e.
summary(modelA)

##
## Call:
## lm(formula = body.size ~ fitness, data = data)
##
## Residuals:
##      Min       1Q   Median       3Q      Max
## -1.87802 -0.39046 -0.01685 0.49769 1.28815
##
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)   
## (Intercept)   6.3164     0.1757 35.939 < 2e-16 ***
## fitness       0.1735     0.0328   5.289 2.99e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6677 on 48 degrees of freedom
## Multiple R-squared: 0.3682, Adjusted R-squared: 0.3551
## F-statistic: 27.98 on 1 and 48 DF, p-value: 2.99e-06

#The p-value for fitness variable 2.99e-06 is less than significant level .05 which makes it a significant variable in explaining the bodysize


#f.
#the Adjusted R-squared: 0.3551 indicates that 35% of variablity among the variables is explained by the model ,which makes it the non-valid model