Statistics and Statistical Programming (Spring 2019)/Problem Set: Week 5
From CommunityData
Programming Challenges[edit]
This week we'll work with the full dataset from which I drew the 20 group samples you analyzed in Weeks 2 and 3.
- PC0. The dataset is available as a TSV file in the directory
week_05
in the data repository for the course. Note that a TSV file is tab delimited, not comma delimited (it is otherwise similar to a CSV file). Go ahead and inspect the data and load it into R (Hint: You'll want to use theread.delim()
function). - PC1. Calculate the mean of the variable
x
in the full dataset. Go back to your Week 3 problem set and revisit the mean you calculated forx
. Be prepared to discuss the conceptual relationship of these two means to each other. - PC2. Again, using the variable
x
from your Week 3 data, compute the 95% confidence interval for the mean of this vector "by hand" (in R) using the normal formula for standard error . (Bonus: Do this by writing a function.) - PC3. Compare the mean of
x
from your Week 3 sample — and your confidence interval — to the population mean (the version ofx
in the Week 5 dataset). Is the true mean inside your confidence interval? Should you find this surprising? Why or why not? Be prepared to discuss the relationship of these values to each other. - PC4. Let's look beyond the mean. Compare the distribution from your sample of
x
to the true population ofx
. Draw histograms and compute other descriptive and summary statistics. What do you notice? Be prepared to discuss and explain any differences. - PC5. Calculate the conditional mean of
x
for each of the groups in the population and the standard deviation of this distribution of conditional means. Compare this standard deviation to the standard error of the mean you calculated in PC2 above. Explain the relationship between these values. - PC6. I want you to run a simple simulation that demonstrates a fundamental insight of statistics. Please see the R lecture materials from Week 4 for ideas about how to do this (but note that there are some differences between that example and this programming challenge).
- (a) Create a vector of 10,000 randomly generated numbers that are uniformly distributed between 0 and 9.
- (b) Calculate the mean of that vector. Draw a histogram of the distribution.
- (c) Create 100 random samples of 2 items each from your randomly generated data and take the mean of each sample. Create a new vector that contains those means. Describe/display the distribution of those means.
- (d) Do (c) except make the items 10 items in each sample instead of 2. Then do (c) again except with 100 items. Be ready to describe how the histogram changes as the sample size increases. (Bonus challenge: Write a function to complete this part.)
- PC7. Compare the results from PC6 with those in the example simulation from the Week 4 R lecture materials. What fundamental statistical principle is illustrated by these simulations? Why is this an important simulation for thinking about hypothesis testing?
Statistical Questions[edit]
Exercises from OpenIntro §5
- SQ0. Any questions or clarifications from the OpenIntro text or lecture notes?
- SQ1. Exercise 5.22 which is about student test scores.
- SQ2. Exercise 5.28 which is about Diamonds
- SQ3. Exercise 5.30 which is also about Diamonds
- SQ4. Exercise 5.48 which is about work hours and education
- SQ5. Exercise 5.52 which is a set of True/False questions about ANOVA
Reinhart §1
- SQ6. Reinhart argues that confidence intervals are preferable to p-values. Be prepared to explain, support and/or refute Reinhart's argument in your own words.
Empirical Paper Questions[edit]
We'll continue our apparent focus on blogs with the following questions about the Sweetser and Metzgar paper.
- EQ1. For RQ4 explain:
- (a) What is the unit of analysis? What is the dependent variable? The independent variable? What are the levels or groups of being compared in the ANOVA?
- (b) Clearly State the null hypothesis being tested. What is the alternative hypothesis?
- (c) Summarize or restate the results in statistical terms. Explain what these results mean in substantive terms.
- (d) How convincing do you find these results? What should we be taking away?
- EQ2. Do the same as above but for RQ5.
- EQ3. ...for RQ6.