Canadian students watch less TV than their American counterparts a a Compare

# Canadian students watch less tv than their american

• welshrodrick
• 9

This preview shows page 6 - 8 out of 9 pages.

Canadian students watch less TV than their American counterparts a (a) Compare the two samples using appropriatedescriptive statistics, including side-by-side boxplots (b) Write an R function z.test(yly2,H1) to compute the p-value for a large sample z-test (discussed in lecture) for testing eqquality of two population means (Ho H2) The arguments tothis function are: y1, a vector containing the sample measurements from the first population; y2, a vector containing the sample measurements from the second population; and H1, a string variable, which takes one of three possible values: 'two.sided', 'less' or greater specifying the alternative hypothesis. To complete this question you willneed to use the R function pnorm) which computes standard normal probabilities, see the help file ?pnorm (e) Apply your function to the TV data, computing the p-values for each of the three possible alternative hypotheses. (d) Which of the three alternative hypotheses is relevant for the particular question being asked in this study? Comment on the results Canada 76.97203 45-71819 .93005 4.14723 0.20757 72.77606 46.53123 73-58473 4.9476 93987 1.49327 47-56986 45.420 7257007 4.49055 45-10214 74.460DE 3.34076 .44517 71.8234 7.3519 42.37042 78.26503 73-44686 43.43587 42- 3281 54.2919 73.-52563 49.19637 4-38735 77.86993 46.11336 4.45665 75.35511 85.30704 47.26076 s07.2627 72.18155 87.49982 707348 .3758 74.22746 04.7940 44.42946 77.58093 70.4487 13.48124 45-301 57.42776 4.22887 5.61557 4.76221 s4.60se 73-59683 32.06265 8.53207
37.90594 64.52083 3.18476 34-59507 47.36931 79.51543