BUSINESS (MGMT 105)
HOMEWORK 4 TEXAS A& M
UNIVERSITY
, lOMoAR cPSD| 19857451
1. Revisiting the faithful data.
a. Using the faithful data frame from homework 3, create a scatterplot of eruption duration vs
time until next eruption, with time until next eruption on the horizontal axis. Add appropriate
titles and axes labels. Use the plotting character of your choice.
Ans. > attach(faithful)
> plot(eruptions~waiting, xlab="Time until next eruption", ylab="Eruption Duration",
col="Blue", ylim=c(0,5), xlim=c(40, 100), main="Eruption vs Time until next Eruption")
Eruption vs Time until next Eruption
5
Eruption Duration
4
3
2
1
0
40 50 60 70 80 90 100
Time until next eruption
b. Add a loess line to your plot using the function panel. Smooth.
Ans. > panel.smooth(faithful$waiting,faithful$eruptions, col = "orange", pch = 13, col.smooth =
"red")
> abline(lm(eruptions~waiting, data=faithful))