Editing Statistics and Statistical Programming (Winter 2021)/Problem set 9
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 5: | Line 5: | ||
This week the programming challenges will focus on the full population ("Seattle bikeshare") dataset from which I drew the 20 group samples you analyzed in [[../Problem set 3]] and [[../Problem set 5]]. | This week the programming challenges will focus on the full population ("Seattle bikeshare") dataset from which I drew the 20 group samples you analyzed in [[../Problem set 3]] and [[../Problem set 5]]. | ||
Nothing here should require anything totally new to you in R. That is why there is no R tutorial this week. Instead, a lot of the focus is on illustrating statistical concepts using relatively simple code. The emphasis is on material covered in ''OpenIntro'' §5 and, for PC6, programming material introduced in '''R Tutorial #5 Part 2'''. | |||
=== PC1. Import the data === | === PC1. Import the data === | ||
Line 19: | Line 19: | ||
==== Interpret the comparison ==== | ==== Interpret the comparison ==== | ||
Knowing that the data you analyzed in [[../Problem set 5|problem set 5]] was a random 5% sample from the dataset distributed for the present problem set, explain the ''conceptual'' relationship of these two means to each other. | |||
=== PC3. Confidence interval of a mean === | === PC3. Confidence interval of a mean === | ||
Again, using the variable <code>x</code> from your [[../Problem set 5|problem set 5]] data, compute the 95% confidence interval for the mean of this vector "by hand" (i.e., in R) using the normal formula for the [https://en.wikipedia.org/wiki/Standard_error#Standard_error_of_the_mean standard error of a mean]: <math>(\frac{\sigma}{\sqrt{n}})</math>, where <math>\sigma</math> is the standard deviation of the sample and <math>n</math> is the number of observations (''Bonus:'' Do this by writing a function.). | Again, using the variable <code>x</code> from your [[../Problem set 5|problem set 5]] data, compute the 95% confidence interval for the mean of this vector "by hand" (i.e., in R) using the normal formula for the [https://en.wikipedia.org/wiki/Standard_error#Standard_error_of_the_mean standard error of a mean]: <math>(\frac{\sigma}{\sqrt{n}})</math>, where <math>\sigma</math> is the standard deviation of the sample and <math>n</math> is the number of observations (''Bonus:'' Do this by writing a function.). | ||
Line 41: | Line 40: | ||
=== PC6. A simulation === | === PC6. A simulation === | ||
Let's conduct a simulation that demonstrates a fundamental principle of statistics. Please see the | Let's conduct a simulation that demonstrates a fundamental principle of statistics. Please see the '''R Tutorial #5 Part 2''' for useful examples that can help you do this. | ||
:* (a) Create a vector of 10,000 randomly generated numbers that are uniformly distributed between 0 and 9. | :* (a) Create a vector of 10,000 randomly generated numbers that are uniformly distributed between 0 and 9. | ||
:* (b) Calculate the mean of the vector you just created. Plot a histogram of the distribution. | :* (b) Calculate the mean of the vector you just created. Plot a histogram of the distribution. | ||
Line 48: | Line 47: | ||
==== Compare and explain the simulation ==== | ==== Compare and explain the simulation ==== | ||
Compare the results from PC6 with those in the example simulation from | Compare the results from PC6 with those in the example simulation from '''R Tutorial #5 Part 2'''. What fundamental statistical principle is illustrated by these simulations? Why is this an important simulation for thinking about hypothesis testing? | ||
== Reading Questions == | == Reading Questions == |