(Old) R – Biostatistics 2019

R – Central Limit Theorem

By


This homework set is based on Lesson ??Central Limit Theorem.  

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

 

I. Goal:

1) Demonstrate Central Limit Theorem by displaying histogram of a population distribution together with histograms of 3 sampling distributions (with different sample sizes) on one sample page:

par()

 

 

II. What to upload to Canvas for the R?? 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 create a skewed or uniform population distribution and repeatedly select samples from the same population.

 

Here are the Details:

1) Come up with a quantitative variable and the population data different than the the example shown in the video

      • Use the data from your last R homework (unless the grader commented that your last homework data were not skewed enough)
      • If for some reasons you want to create a brand new set of data, you can certainly do so be creative! Don’t just copy my example. Come up with something DIFFERENT than the example shown in the video — you will NOT receive full credit if your variable is TOO SIMILAR to mine — e.g.?????/ is TOO SIMILAR to my example!
      • Your variable can be biology-related (but it doesn’t have to be).
      • Create a set of population data with the following requirements:
        • Use the data from your last R homework (unless the grader commented that your last homework data were not skewed enough)
        • there should should be 12 individual observations
        • the data are skewed or uniform (i.e. non-normal)

 

 

2) Select 100 samples of size 2 from the population and calculate the corresponding sample means

 

3) Select 100 samples of size 4 from the population and calculate the corresponding sample means

 

4) Select 100 samples of size 7 from the population and calculate the corresponding sample means

 

5) Display the histograms of the population, sample means from samples of size 2, 4, and 7 in a 2-by-2 format.

 

 

6) 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 the population and the quantitative variable you have
        • State what the units of measurement are
        • It is optional to include other information such as assignment name, etc.
        • Show clearly how you use the following commands:
            • c()
            • hist()
            • for loop
            • par()

 

7) 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.