1. With the Braking R data, produce a scatterplot of Distance versus Speed, and overlay a plot of the regression predictions using the Third Try model (with the distance-speed ratio as the outcome...

1 answer below »

View more »
Answered 1 days AfterNov 30, 2021

Answer To: 1. With the Braking R data, produce a scatterplot of Distance versus Speed, and overlay a plot of...

Atreye answered on Dec 02 2021
115 Votes
Solution 1
Load the dataset
load("C:/Users/Mili/Downloads/braking-dutcqxaw.rdata")
head(Braking)
## Speed Distance
## 1 4 2
## 2 4 10
## 3 7 4
## 4 7 22
## 5 8 16
## 6 9 10
scatterplot of Distance versus Speed with a plot of the regression predictions using the Third Try model along with 95% confidence band.
library(tidyr)
library(ggplot2)
library(MASS)
Braking$DistRatio = Braking$Dista
nce/Braking$Speed
plotdata <- data.frame(x=Braking$Speed, Braking$Distance, Braking$DistRatio)
pd <- gather(plotdata, Series, value, -x)
ggplot(pd, aes(x = x, y = value, colour = Series, shape = Series)) +
geom_point() +
geom_smooth(method = rlm)
## `geom_smooth()` using formula 'y ~ x'
Solution 2
Fit a linear regression model and calculating confidence intervals
model <- lm(Distance ~ Speed, data = Braking)
new_dat <- data.frame(Speed=30)
predict(model, newdata = new_dat, interval = 'confidence')
## fit lwr upr
## 1 100.3932 87.43543 113.3509
Conclusion
From the output, it is observed that the fitted stopping distance at 30 mph speed is just above 100 feet. The confidence interval of (87.44, 113.35) implies the range in which the true population parameter belongs at a 95% level of confidence. # Solution 3
package insatllation and sat dataload
library(faraway)
sat
## expend ratio salary takers verbal math total
## Alabama 4.405 17.2 31.144 8 491 538 1029
## Alaska 8.963 17.6 47.951 47 445 489 934
## Arizona 4.778 19.3 32.175 27 448 496 944
## Arkansas 4.459 17.1 28.934 6 482 523 1005
## California 4.992 24.0 41.078 45 417 485 902
## Colorado 5.443 18.4 34.571 29 462 518 980
## Connecticut 8.817 14.4 50.045 81 431 477 908
## Delaware 7.030 16.6 39.076 68 429 468 897
## Florida 5.718 19.1 32.588 48 420 469 889
## Georgia 5.193 16.3 32.291 65 406 448 854
## Hawaii 6.078 17.9 38.518 57 407 482 889
## Idaho 4.210 19.1 29.783 15 468 511 979
## Illinois 6.136 17.3 39.431 13 488 560 1048
## Indiana 5.826 17.5 36.785 58 415 467 882
## Iowa 5.483 15.8 31.511 5 516 583 1099
## Kansas 5.817 15.1 34.652 9 503 557 1060
## Kentucky 5.217 17.0 32.257 11 477 522 999
## Louisiana 4.761 16.8 26.461 9 486 535 1021
## Maine 6.428 13.8 31.972 68 427 469 896
## Maryland 7.245 17.0 40.661 64 430 479 909
## Massachusetts 7.287 14.8 40.795 80 430 477 907
## Michigan 6.994 20.1 41.895 11 484 549 1033
## Minnesota 6.000 17.5 35.948 9 506 579 1085
## Mississippi 4.080 17.5 26.818 4 496 540 1036
## Missouri 5.383 15.5 31.189 9 495 550 1045
## Montana 5.692 16.3 28.785 21 473 536 1009
## Nebraska 5.935 14.5 30.922 9 494 556 1050
## Nevada 5.160 18.7 34.836 30 434 483 917
## New Hampshire 5.859 15.6 34.720 70 444 491 935
## New Jersey 9.774 13.8 46.087 70 420 478 898
## New Mexico 4.586 17.2 28.493 11 485 530 1015
## New York 9.623 15.2 47.612 74 419 473 892
## North Carolina 5.077 16.2 30.793 60 411 454 865
## North Dakota 4.775 15.3 26.327 5 515 592 1107
## Ohio 6.162 16.6 36.802 23 460 515 975
## Oklahoma 4.845 15.5 28.172 9 491 536 1027
## Oregon 6.436 19.9 38.555 51 448 499 947
## Pennsylvania 7.109 17.1 44.510 70 419 461 880
## Rhode Island 7.469 14.7 40.729 70 425 463 888
## South Carolina 4.797 16.4 30.279 58 401 443 844
## South Dakota 4.775 14.4 25.994 5 505 563 1068
## Tennessee 4.388 18.6 32.477 12 497 543 1040
## Texas 5.222 15.7 31.223 47 419 474 893
## Utah 3.656 24.3 29.082 4 513 563 1076
## Vermont 6.750 13.8 35.406 68 429 472 901
## Virginia 5.327 14.6 33.987 65 428 468 896
## Washington 5.906 20.2 36.151 48 443 494 937
## West Virginia 6.107 14.8 31.944 17 448 484 932
## Wisconsin 6.930 15.9 37.746 9 501 572 1073
## Wyoming 6.160 14.9 31.285 10 476 525 1001
Multiple Regression model fit
model <-...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here
April
January
February
March
April
May
June
July
August
September
October
November
December
2025
2025
2026
2027
SunMonTueWedThuFriSat
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30