Two sample t-Test in R

See Video  ☝



In this video you will learn how to carry out a two-sample T-test in R studio.

The Video will include:
  • Brief description of two sample t-Test
  • Visualizing the data set
  • Performing two-sample t-Test in R studio 

If a data set is obtained from two samples and population variance is not known. For such two sample means, the t-test is more often used. The T-test is usually applied for a sample size lower than thirty.

Let’s see the example data set.

A researcher grows maize plants in two separate fields. As the plants are ready to be harvested. He is interested to see the difference in cob length. He takes a random sample of 6 plants from both fields. He measured the cob length. The object X one shows the cob length of cobs measured from field one. The object X two shows the cob length recorded from the second field.

First, formulate the hypothesis.
  • Null hypothesis: H0: µ1 = µ2    or    µ1 - µ2 = 0
  • Alt hypothesis:  H1: µ1 ≠ µ2    or    µ1 - µ2 ≠ 0

Test the hypothesis at 0.05 level of significance

The null hypothesis shows that there is no difference in the mean cob length of both fields. Or, the difference in the mean cob length of both fields is equal to zero. The alternate hypothesis is the opposite of the null hypothesis. It means the difference in the mean cob length of both fields is not equal to zero. Let’s test this hypothesis at a 5 percent confidence level.

Comments

Popular posts from this blog

Two way repeated measures analysis in R

Split plot analysis in R

Principal component analysis in R