Editing Statistics and Statistical Programming (Winter 2021)/Problem set 9

From CommunityData
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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


With the exception of the final question, nothing here should require anything totally new to you in R. 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 this week's R tutorial.
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 ====


The data that you analyzed in [[../Problem set 5|problem set 5]] was a random 5% sample from the dataset distributed for the present problem set. Knowing that, explain the ''conceptual'' relationship of these two means to each other.
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 29: Line 28:


=== PC4. Compare distributions ===  
=== PC4. Compare distributions ===  
Let's go beyond the mean. Compare the distribution from your [[../Problem set 5|problem set 5]] <code>x</code> vector to the aggregate version of <code>x</code> in this week's data. Draw histograms (or density plots) and compute other descriptive and summary statistics.  
Let's go beyond the mean alone. Compare the distribution from your Problem Set 2 <code>x</code> vector to the aggregate version of <code>x</code> in this week's data. Draw histograms (or density plots) and compute other descriptive and summary statistics.  


==== Interpret the comparison ====  
==== Interpret the comparison ====  
Line 40: Line 39:
Compare the standard deviation of the means across all groups that you just calculated to the standard error you calculated in PC3 above. Discuss and explain the relationship between these values.
Compare the standard deviation of the means across all groups that you just calculated to the standard error you calculated in PC3 above. Discuss and explain the relationship between these values.


=== PC6. A simulation ===  
=== (Recommended) PC6. A simulation ===  
Let's conduct a simulation that demonstrates a fundamental principle of statistics. Please see the today's R tutorial for useful examples that can help you do this.
Let's conduct a simulation that demonstrates a fundamental principle of statistics. Please see the [https://communitydata.science/~ads/teaching/2020/stats/r_tutorials/w05-R_tutorial.html R tutorial materials from last week] 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 today's R tutorial. What fundamental statistical principle is illustrated by these simulations? Why is this an important simulation for thinking about hypothesis testing?
Compare the results from PC6 with those in the example simulation from [https://communitydata.science/~ads/teaching/2020/stats/r_tutorials/w05-R_tutorial.html last week's R tutorial]. What fundamental statistical principle is illustrated by these simulations? Why is this an important simulation for thinking about hypothesis testing?


== Reading Questions ==
== Reading Questions ==
Line 56: Line 55:
Reinhart (§1) argues that confidence intervals are preferable to p-values. Be prepared to explain, support and/or refute Reinhart's argument in your own words.
Reinhart (§1) argues that confidence intervals are preferable to p-values. Be prepared to explain, support and/or refute Reinhart's argument in your own words.


=== RQ2. Emotional contagion ===
=== RQ2. Emotional contagion (revisited) ===
 
Let's talk about the short emotional contagion paper:


: Kramer, Adam D. I., Jamie E. Guillory, and Jeffrey T. Hancock. 2014. Experimental Evidence of Massive-Scale Emotional Contagion through Social Networks. ''Proceedings of the National Academy of Sciences'' 111(24):8788–90. {{avail-uw|http://www.pnas.org/content/111/24/8788.full}}
Revisit the paper we read a couple of weeks ago:
: Kramer, Adam D. I., Jamie E. Guillory, and Jeffrey T. Hancock. 2014. Experimental Evidence of Massive-Scale Emotional Contagion through Social Networks. ''Proceedings of the National Academy of Sciences'' 111(24):8788–90. [[http://www.pnas.org/content/111/24/8788.full Open Access]]


Come to class prepared to discuss your answers to the following questions.  
Come to class prepared to discuss your answers to the following questions.  
Line 66: Line 64:
==== RQ2a. Hypotheses ====
==== RQ2a. Hypotheses ====
Write down, in your own words, the key pairs of null/alternative hypotheses tested in the paper (hint: the four pairs that correspond to the main effects represented in the figure).
Write down, in your own words, the key pairs of null/alternative hypotheses tested in the paper (hint: the four pairs that correspond to the main effects represented in the figure).
====RQ2b. Describe the effects ====
====RQ2b. Describe the effects ====
Describe, in your own words, the main effects estimated in the paper for these four key pairs of hypotheses.
Describe, in your own words, the main effects estimated in the paper for these four key pairs of hypotheses.
====RQ2c. Statistical vs. practical significance ====
====RQ2c. Statistical vs. practical significance ====
The authors report ''[https://en.wikipedia.org/wiki/Effect_size#Cohen's_d Cohen's d]'' along with their regression estimates of the main effects. Look up the formula for ''Cohen's d.'' Discuss the ''substantive'' or ''practical'' significance of the estimates given the magnitudes of the ''d'' values reported.
The authors report ''[https://en.wikipedia.org/wiki/Effect_size#Cohen's_d Cohen's d]'' along with their regression estimates of the main effects. Look up the formula for ''Cohen's d.'' Discuss the ''substantive'' or ''practical'' significance of the estimates given the magnitudes of the ''d'' values reported.
Please note that all contributions to CommunityData are considered to be released under the Attribution-Share Alike 3.0 Unported (see CommunityData:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

Template used on this page: