R — Biostatistics

R6—Two-sample t test (two-sided)

By


This homework set is based on Lesson 6Two-sample t test (two-sided).  

You need to watch the video in Lesson 6 BEFORE you do this homework set.

 

I. Goals:

1) Conduct a two-sided t test for comparing two population means

t.test()

 

 

II. What to upload to Canvas for the R6 assigment?

You ONLY need to upload your R script to Canvas by the due date and time:

      • R script (.R)

 

Important: What the grader and I will do is to run your .R script on our computer to generate the result. So make sure your .R script works!

The best way for you is to check if your script works or not is to do the following:

    • After you have uploaded your script to Canvas, log out of Canvas and then log back into Canvas. Download your .R script and run it on your RStudio to see if it works!

 

III. What to do for this assignment

  • Create one .R script to conduct a two-sided t test for comparing two population means such that the data do NOT provide enough evidence for the alternative hypothesis i.e. the P-value is greater than the level of significance (5%).

 

Here are the Details:

1) Come up with a quantitative variable and a two-sided hypothesis test that are TOTALLY DIFFERENT than the the example shown in the video

      • Be creative! Don’t just copy my example. To receive full credit, you need to come up with something TOTALLY DIFFERENT than the example shown in the video — DO NOT use plants (or flowers) in your example.  There are still many examples in biology or daily life that do NOT involve plants or flowers!
      • Your variable can be biology-related (but it doesn’t have to be).
      • Create two groups of data that meets the following requirements:
        • each group of data should have between 8 to 12 observations (the two groups of data can have the same or different number of observations).
        • after running the t.test comment, your  P-value from your data should greater than alpha (i.e. the data do NOT provide enough evidence for the alternative hypothesis).
        • Your t value can be positive or negative.

 

2) To receive full credits, your R script needs to satisfy the following:

      • At the top of your R script, use # to:
        • Type your name 
        • Type a sentence or two to explain what difference you are testing e.g. you can say “To determine if there is a difference between …. and …..”
        • Explain your notations for the two groups of data
        • State what the units of measurement are
        • It is optional to include other information such as assignment name, etc.
      • Show clearly how you create the two sets of data
      • Show clearly how you use the t.test() command

 

3) To receive full credits, your two-sided test should satisfy the following:

        • Your P-value is greater than alpha (5%)

 

4) Upload the following item to Canvas by the due date and time.

        • R script (.R)

-END-



Content is copyright the author. Layout is copyright Mark Ciotola. See Corsbook.com for further notices.