Question

In: Statistics and Probability

The Marseille Water Taxi ferries tourists from the harbor at Marseille, France, to the Frioul Islands...

The Marseille Water Taxi ferries tourists from the harbor at Marseille, France, to the Frioul Islands in the Mediterranean Sea. The table below shows the number of passengers on the noontime ferry over seven randomly selected days along with the current ambient temperature in degrees Celsius.

Temperature Passengers

16 15

19 20

22 20

26 22

18 10

24 18

Run a regression where "Temperature" is the independent variable and "Passengers" is the dependent variable. Interpret the coefficient of determination in your own words.

Solutions

Expert Solution

Sol:

create a dataframe df2 with the the given data

use lm fucntion in R to fit a model

Plot function to get the scatterplot

abline to get the regression line on plot

summary function in R to get R sq

Rcode:

levels = c("1", "2", "3","4"))
df2 =read.table(header = TRUE, text ="
Temperature Passengers

16 15

19 20

22 20

26 22

18 10

24 18

"
)
df2


linreg <- lm(Passengers~Temperature,data=df2)
plot(x= df2$Temperature,y=df2$Passengers,
main="Scatterplot of Passengers vs Temperature",
xlab="Temperature",ylab="Passengers")
abline(coef(linreg)[1:2],col='red')

## rounded coefficients for better output
cf <- round(coef(linreg), 4)

check to avoid having plus followed by minus for negative coefficients
eq <- paste0("Passengers = ", cf[1],
ifelse(sign(cf[2])==1, " + ", " - "), abs(cf[2]), "Temperature "
)

## printing of the equation
mtext(eq, 3, line=0)


Call:
lm(formula = Passengers ~ Temperature, data = df2)

Residuals:
1 2 3 4 5 6
1.249 3.922 1.595 0.492 -5.302 -1.957

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.3387 8.8956 0.150 0.888
Temperature 0.7757 0.4211 1.842 0.139

Residual standard error: 3.594 on 4 degrees of freedom
Multiple R-squared: 0.4589,   Adjusted R-squared: 0.3237
F-statistic: 3.393 on 1 and 4 DF, p-value: 0.1393

Regression line to predict passengers is

passengers=1.3387+0.7757 *temperature

R sq=0.4589

45.89% variation in Passengers is explained by model

Explained variance=45.89%

Unexplained variance=100-45.89=54.11%


Related Solutions

The Marseille Water Taxi ferries tourists from the harbor at Marseille, France, to the Frioul Islands...
The Marseille Water Taxi ferries tourists from the harbor at Marseille, France, to the Frioul Islands in the Mediterranean Sea. The table below shows the number of passengers on the noontime ferry over seven randomly selected days along with the current ambient temperature in degrees Celsius. Temperature Passengers 16 15 19 20 22 20 26 22 18 10 24 18 Use the Marseille Water Taxi data to calculate the 95% prediction interval for the number of passengers on a day...
1. VECTOR PROBLEM: The helicopter travels to accommodate the tourists among the three islands of the...
1. VECTOR PROBLEM: The helicopter travels to accommodate the tourists among the three islands of the Philippines. It moves from the first island going to the second island with a distance of 4.76 km, 37° N of E. It then sails from the second island going to the last island in a direction of 69° W of N. Lastly, the helicopter goes back to the first island pointing in the direction of 28° E of S. Solve for the distance...
You have decided to create a perpetual fund to support the Boston Harbor Islands and would...
You have decided to create a perpetual fund to support the Boston Harbor Islands and would like the first payment to be made in 5 years. Interest rates are 6% and you would like the payments to increase by 2% each year. How much should you invest today if you want the first payment to be $15,000 in 5 years? How should I solve this using an hp10bii+ calculator? Could you please show me the steps?
In 1990, the town of Ham Harbor had a more-or-less free market in taxi services. Any...
In 1990, the town of Ham Harbor had a more-or-less free market in taxi services. Any respectable firm could provide taxi service as long as the drivers and cabs satisfied certain safety standards. Let us suppose that the constant marginal cost per trip of a taxi ride is $5, and that the average taxi has a capacity of 20 trips per day. Let the demand function for taxi rides be given by D(P)1200 − 20P where demand is measured in...
1.Consider a nation with two islands separated by water infestedwith fire-breathing dragons. Initially both islands...
1.Consider a nation with two islands separated by water infested with fire-breathing dragons. Initially both islands are self-sufficient and there are no cities. Suppose a dragon-whisperer tames the dragons and harnesses them to serve as air cargo carriers/a. The dragon re-purposing will cause trade if...b. If the dragon re-purposing causes trade, a trading city will develop if...2.Explain the causes and the different kinds of agglomeration economies. How does size of the city generate lower wages and production cost?
Uses Solomon Islands and explain with examples: One important lesson from the current covid-19 is the...
Uses Solomon Islands and explain with examples: One important lesson from the current covid-19 is the vulnerability of economies dependent on foreign aid, foreign investment and trade (goods and services) and hence the importance of domestic investment (i.e. encouraging the private sector to invest in essential sectors such as food production in case of such prolonged shut-down of global movement of people, goods and services). On this note, discuss the importance of domestic investment for self-sufficiency, economic expansion and employment....
Happiness in tourism, from a generalist perspective, focuses on two large interest groups, tourists - who...
Happiness in tourism, from a generalist perspective, focuses on two large interest groups, tourists - who seek worthwhile experiences and provide the maximum satisfaction - and the community that receives them - which is satisfied when there is a balance between the yearnings of the visitor, entrepreneurs, public managers and theirs. Thus, how to align the strategic needs of the tourist destination with those inherent in sustainable development and without harming local happiness? Discuss and give an examples
ferry services are getting more popular among tourists in Turkey. Apart from safety aspects, timing of...
ferry services are getting more popular among tourists in Turkey. Apart from safety aspects, timing of the journeys is always monitored, as lengthier and shorter journeys than scheduled are not desirable. For a service between Istanbul and Bursa in the Sea of Marmara, the ferries’ travel times are monitored for 15 days, four sample journeys each day. The results are shown in the table below. MEAN(MINUTES) MINIMUM MAXIMUM 121 117 125 123 119 126 124 119 125 115 113 117...
Tourists in Bintan island, a 45-minute ferry ride from Singapore, are demanding the latest espresso drinks...
Tourists in Bintan island, a 45-minute ferry ride from Singapore, are demanding the latest espresso drinks from a familiar brand but their small number means demand can only sustain one new coffee shop. You and another popular chain, Starbucks, are considering making the considerable investment necessary to set up a shop in Bintan. Analyse the interaction between the two firms using game theory. Present a payoff matrix to model the situation and analyse it for Nash equilibrium. What can you...
QUESTION 5 Tourists in Bintan island, a 45-minute ferry ride from Singapore, are demanding the latest...
QUESTION 5 Tourists in Bintan island, a 45-minute ferry ride from Singapore, are demanding the latest espresso drinks from a familiar brand but their small number means demand can only sustain one new coffee shop. You and another popular chain, Starbucks, are considering making the considerable investment necessary to set up a shop in Bintan. Analyse the interaction between the two firms using game theory. Present a payoff matrix to model the situation and analyse it for Nash equilibrium. What...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT