In: Statistics and Probability
A highway department is studying the relationship between traffic flow and speed. The following model has been hypothesized.
y = B 0 + B 1 x + B2x 2 + E
where
y = traffic flow in vehicles per hour
x = vehicle speed in miles per hour
The following data were collected during rush hour for six highways leading out of the city.
Traffic Flow (y) | Vehicle Speed (x) |
1,256 | 35 |
1,329 | 45 |
1,226 | 30 |
1,335 | 50 |
1,349 | 55 |
1,124 | 25 |
Enter negative values as negative, if necessary.
Show the estimated regression equation (to 3 decimals, if
necessary).
y = ------ + ---------- x + -------------
x 2
What is the value of the coefficient of determination (to 3
decimals)? Note: report R 2 between 0 and 1.
What is the value of the F test statistic (to 2 decimals)?
What is the p-value?
Selectless than .01between .01 and .025between .025 and .05between
.05 and .10greater than .10Item 6
Using = .01, what is your conclusion?
SelectConclude a curvilinear relationship exists for traffic flow
and speedCannot conclude a curvilinear relationship exists for
traffic flow and speedItem 7
Predict the traffic flow in vehicles per hour for a speed of 39
miles per hour (to the nearest whole number).
y = c(1256,1329,1226,1335,1349,1124)
x = c(35,45,30,50,55,25)
model = lm(y~poly(x,2)) # or lm(y~x+I(x^2))
round(coef(model),3) # Reg Coefficients
summary(model)$r.squared # R^2
summary(model)$fstatistic[1] # Fstatistic
anova(model)$'Pr(>F)'[1] # Pvalue
predict(model,data.frame(x=39)) # Predicted value