You are on page 1of 1

3. Page no. 121, Problem no.

27

a) Compute the mean price for a round trip flight into Atlanta and the mean price for a round trip
flight in Salt Lake City. Is Atlanta less expensive to fly into than Slat Lake City? If so, what could
explain this difference?

> library(readxl)

> Round_Trip_Cost <- read_excel("D:/Assignments - Usha/Round Trip Cost.xlsx")

> View(Round_Trip_Cost)

> attach(Round_Trip_Cost)

> mean(Atlanta)

[1] 356.7286

> mean(`Salt Lake City`)

[1] 400.95

b) Compute the range, variance, and standard deviation for the two samples. What does this
information tell you about the prices for flights into these two cities?

> range(Atlanta)

[1] 249.6 539.6

> range(`Salt Lake City`)

[1] 159.6 618.4

> var(Atlanta)

[1] 5517.408

> var(`Salt Lake City`)

[1] 18933.32

> sd(Atlanta)

[1] 74.27926

> sd(`Salt Lake City`)


[1] 137.5984

You might also like