R Lab 1 - 1 Intro R Lab 1 Hypothesis Tests on Variances The...

This preview shows page 1 - 2 out of 3 pages.

1Intro R Lab 1 Hypothesis Tests on VariancesThe commandvar.testcan be used to carry out a hypothesis to compare variances of twosamples from Normal populations. First I need the samples to be column vectors. So afterreading in data from a file, or entering directly into a vector I can produce two vectors say“data1” and “data2”.Suppose I have the following datadata1=c(12.4, 4.5, 6.8, 9.4, 7.3, 2.3)data2=c(14.5, 6.7, 20.0, 16.3, 14,8)When I usevar.testI specify the hypothesised ratio usingratio=1.If the alternative isHa:σ1σ26= 1, I specify this withalternative=”two.sided”. The other two possible alternativehypothesis options arealternative=”less”oralternative=”greater”. We can test for equalityof variances usingvar.test(data1, data2).T-testIf I want to perform a two sample T-test, I use the commandt.test(data1, data2). Thereare options for this test that I will have to consider.If myHA:μ1> μ2then I use theoptionalternative=”greater”alternatively I can use“less” or “two.sided”. I also need

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture