Question

In: Statistics and Probability

A Bloomberg Businessweek subscriber study asked, “in the past 12 months, when traveling for business, what...

A Bloomberg Businessweek subscriber study asked, “in the past 12 months, when traveling for business, what type of airline ticket did you purchase most often?” A second question asked if the type of airline ticket purchased most often was for domestic or international travel. Sample data obtained are shown in the following table.

Type of Ticket

Domestic Flight

International Flight

First class

29

22

Business class

95

121

Economy class

518

135

A) The study wants to test whether the type of ticket is independent of the type of flight. Clearly state the null and alternative hypotheses. (2 points)

B) Compute the expected frequencies by completing the table below. (3 points)

Type of Ticket

Domestic Flight

International Flight

Total

First Class

Business Class

Economy Class

Total

C) Compute the test statistic.

Please copy your R code and the result and paste them here.

D) At 5% significance level, compute the critical value for the test statistic and the p value for the test. Draw your conclusion. (5 points)

Please copy your R code and the result and paste them here.

E) Use the function chisq.test() in R to run the test directly to confirm your results above are correct. (4 points)

Please copy your R code and the result and paste them here.

Solutions

Expert Solution

A) The study wants to test whether the type of ticket is independent of the type of flight. Clearly state the null and alternative hypotheses. (2 points)

Ho: type of ticket is independent of the type of flight

H1: type of ticket is not independent of the type of flight

B) Compute the expected frequencies by completing the table below. (3 points)

Type of Ticket

Domestic Flight

International Flight

Total

First Class

35.5891

15.4109

51

Business Class

150.7304

65.2696

216

Economy Class

455.6804

197.3196

653

Total

642

278

920

C) Compute the test statistic.

Please copy your R code and the result and paste them here.

R code:

observed = c(29,22,95,121,518,135)    # observed frequencies

expected = c(35.5891, 15.4109, 150.7304, 65.2696, 455.6804, 197.3196)# expected frequencies

chi2 = sum((observed- expected)^2/ expected)

chi2

R output:

[1] 100.4334

D) At 5% significance level, compute the critical value for the test statistic and the p value for the test. Draw your conclusion. (5 points)

Please copy your R code and the result and paste them here.

R code:

qchisq(.95, df=2)        # 7 degrees of freedom

pchisq(chi2, df=2,lower.tail=FALSE)

R output:

> qchisq(.95, df=2)        # 7 degrees of freedom

[1] 5.991465

> pchisq(chi2, df=2,lower.tail=FALSE)

[1] 1.552954e-22

E) Use the function chisq.test() in R to run the test directly to confirm your results above are correct. (4 points)

Please copy your R code and the result and paste them here.

Rcode:

M <- as.table(rbind(c(29,22), c(95,121),c(518,135)))

chi2<- chisq.test(M)

chi2

R output:

        Pearson's Chi-squared test

data: M

X-squared = 100.43, df = 2, p-value < 2.2e-16


conclusion: calculated chi square 100.43 > 5.991, the critical value at 0.05 level of significance. Ho is rejected. we conclude that the type of ticket is not independent of the type of flight.


Related Solutions

A Bloomberg BusinessWeek subscriber study asked, "In the past 12 months, when traveling for business, what...
A Bloomberg BusinessWeek subscriber study asked, "In the past 12 months, when traveling for business, what type of airline ticket did you purchase most often?" A second question asked if the type of airline ticket purchased most often was for domestic or international travel. Sample data obtained are shown in the following table. Type of Flight Type of Ticket Domestic International First Class 26 23 Business Class 96 129 Economy Class 513 134 a. Using a .05 level of significance,...
A Bloomberg Businessweek subscriber study asked, “in the past 12 months, when traveling for business, what...
A Bloomberg Businessweek subscriber study asked, “in the past 12 months, when traveling for business, what type of airline ticket did you purchase most often?” A second question asked if the type of airline ticket purchased most often was for domestic or international travel. Sample data obtained are shown in the following table. Type of Ticket Domestic Flight International Flight First class 29 22 Business class 95 121 Economy class 518 135 The study wants to test whether the type...
A Bloomberg BusinessWeek subscriber study asked, "In the past 12 months, when traveling for business, what...
A Bloomberg BusinessWeek subscriber study asked, "In the past 12 months, when traveling for business, what type of airline ticket did you purchase most often?" A second question asked if the type of airline ticket purchased most often was for domestic or international travel. Sample data obtained are shown in the following table. Type of Flight Type of Ticket Domestic International First Class 22 26 Business Class 125 94 Economy Class 131 513 a. Using a .05 level of significance,...
A Bloomberg Businessweek subscriber study asked, "In the past 12 months, when traveling for business, what...
A Bloomberg Businessweek subscriber study asked, "In the past 12 months, when traveling for business, what type of airline ticket did you purchase most often?" A second question asked if the type of airline ticket purchased most often was for domestic or international travel. Sample data obtained are shown in the following table. Compute the value of the test statistic (to 2 decimals). Type of Flight Type of Ticket Domestic International First Class 26 22 Business Class 95 121 Economy...
A Bloomberg BusinessWeek subscriber study asked, "In the past 12 months, when traveling for business, what...
A Bloomberg BusinessWeek subscriber study asked, "In the past 12 months, when traveling for business, what type of airline ticket did you purchase most often?" A second question asked if the type of airline ticket purchased most often was for domestic or international travel. Sample data obtained are shown in the following table. Type of Flight Type of Ticket Domestic International First Class 21 28 Business Class 122 92 Economy Class 131 515 Compute the value of the  2 test statistic...
A Bloomberg BusinessWeek subscriber study asked, "In the past 12 months, when traveling for business, what...
A Bloomberg BusinessWeek subscriber study asked, "In the past 12 months, when traveling for business, what type of airline ticket did you purchase most often?" A second question asked if the type of airline ticket purchased most often was for domestic or international travel. Sample data obtained are shown in the following table. Type of Flight Type of Ticket Domestic International First Class 26 23 Business Class 99 123 Economy Class 518 132 a. Using a .05 level of significance,...
A Bloomberg BusinessWeek subscriber study asked, "In the past 12 months, when traveling for business, what...
A Bloomberg BusinessWeek subscriber study asked, "In the past 12 months, when traveling for business, what type of airline ticket did you purchase most often?" A second question asked if the type of airline ticket purchased most often was for domestic or international travel. Sample data obtained are shown in the following table. Type of Flight Type of Ticket Domestic International First Class 24 29 Business Class 121 98 Economy Class 131 517 a. Using a .05 level of significance,...
A Bloomberg Busines sweek subscriber study asked, "In the past 12 months, when traveling for business,...
A Bloomberg Busines sweek subscriber study asked, "In the past 12 months, when traveling for business, what type of airline ticket did you purchase most often?" A second question asked if the type of airline ticket purchased most often was for domestic or international travel. Sample data obtained are shown in the following table. Type of Flight Type of Ticket Domestic International First Class 26 21 Business Class 98 122 Economy Class 512 131 a. Using a.05 level of significance,...
A magazine subscriber study asked, "In the past 12 months, when traveling for business, what type...
A magazine subscriber study asked, "In the past 12 months, when traveling for business, what type of airline ticket did you purchase most often?" A second question asked if the type of airline ticket purchased most often was for domestic or international travel. Sample data obtained are shown in the following table. Type of Ticket Type of Flight Domestic International First class 31 24 Business class 93 119 Economy class 518 135 A) Using a 0.05 level of significance, is...
A magazine subscriber study asked, "In the past 12 months, when traveling for business, what type...
A magazine subscriber study asked, "In the past 12 months, when traveling for business, what type of airline ticket did you purchase most often?" A second question asked if the type of airline ticket purchased most often was for domestic or international travel. Sample data obtained are shown in the following table. Type of Ticket Type of Flight Domestic International First class 26 19 Business class 98 124 Economy class 518 135 (a) Using a 0.05 level of significance, is...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT