Programming Challenges

No worked solutions to programming challenges this week. Make sure you completed the assignment as described. Contact us if you have trouble or are uncertain.

Statistical Questions

All questions taken from the OpenIntro textbook, Chapter 1.

SQ1 — 1.6

  1. 129 UC Berkeley students.
  2. From the description in the question text and the paper it seems like there are two primary measures:
  • Unethical behavior (candies taken): discrete continuous measure.
  • Perceived social class (experimental treatment): categorical measure.
  1. Many possible answers here. A basic one turns the first sentence around: What is the difference in unethical behavior by (perceived) social class?

Note that the summary in OpenIntro sort of bungles/ignores the fact that the paper focuses on perceived social class rather than social class. That’s a shame since the paper is very clear. I plan to contact the textbook authors about it if there are no corrections in the 4th edition.

SQ2 — 1.12

  1. The population of interest is humans. The sample is the 129 UC Berkeley undergraduates who participated in the study.
  2. Generalizability seems…limited in this study, although the paper describes an experiment in which perceived social class is manipulated and thus supports causal identification of effects of priming on unethical behavior. The study as described in the textbook does not support causal interpretations.

SQ3 — 1.52

The median here looks to be about 80, while the mean looks to be about 75. You would expect this relationship (median > mean) because of the left skew of the data.

SQ4 — 1.56

  1. The distribution is right skewed with potential outliers on the positive end, therefore the median and the IQR are preferable measures of center and spread.

  2. The distribution is somewhat symmetric and has few, if any, extreme observations, therefore the mean and the standard deviation are preferable measures of center and spread.

  3. The distribution would be right skewed. There would be some students who did not consume any alcohol, but this is the minimum since students cannot consume fewer than 0 drinks. There would be a few students who consume many more drinks than their peers, giving the distribution a long right tail. Due to the skew, the median and IQR would be preferable measures of center and spread.

  4. The distribution would be right skewed. Most employees would make something on the order of the median salary, but we would anticipate upper management makes much more. The distribution would have a long right tail, and the median and the IQR would be preferable measures of center or spread.

SQ5 — 1.64

  1. The distribution of percentage of population that is Hispanic is extremely right skewed with majority of counties with less than 10% Hispanic residents. However there are a few counties that have more than 90% Hispanic population. It might be preferable, in certain analyses, to use the log-transformed values since this distribution is much less skewed.

  2. The map reveals that counties with higher proportions of Hispanic residents are clustered along the Southwest border, all of New Mexico, a large swath of Southwest Texas, the bottom two-thirds of California, and in Southern Florida. In the map all counties with more than 40% of Hispanic residents are indicated by the darker shading, so it is impossible to discern the how high Hispanic percentages go. The histogram reveals that there are counties with over 90% Hispanic residents. The histogram is also useful for estimating measures of center and spread.

  3. Both visualizations are useful and a preference for one over the other most likely depends on the context in which you planned to use it.

Empirical Paper Questions

All questions refer to the Kramer et al. study identified on the course website.

EQ1

  1. The cases are 689,003 individuals included in the study.

  2. The key variables include:
  • Emotional exposure (whether positive or negative words were potentially reduced): dichotomous categorical.
  • Percentage of positive/negative emotion words in posts: continuous numeric.
  1. Many possible responses, but here’s one: Does emotional contagion occur via social networks online?

EQ2

  1. The treatment groups received a reduced portion of posts in their news feed with either positive or negative words in them. The control groups had random posts removed from their news feed.

  2. The study uses random sampling (by an internal account ID number).

  3. See part (a) of this question. The manipulation involved probabilistically reducing the proportion of news feed posts with either positive or negative language in them.

EQ3

  1. Humans.

  2. 689,003 English language Facebook users during a week or so in January 2012.

  3. Many possible answers. Personally, I find such generalization a bit iffy (despite the sample size) given the likely biases of the sample in comparison to the target population of the study. English language Facebook users have a number of attributes that differentiate them from even a broader English language speaking population in the U.S. and Facebook users and it’s likely that some of these attributes systematically covary with the outcomes of interest in this study. Covariance (non-independence) between these factors and the outcomes of interest would render the estimated effects subject to bias.

EQ4

See the figure and the discussion in the paper. The four panels capture the comparisons of the treatment and control conditions by the two outcome measures. They show that the treatments had the anticipated effects with reduced positive posts reducing/increasing the proportion of positive/negative words in subsequent posts and reduced negative posts reducing/increasing the proportion of negative/positive words in subsequent posts.

EQ5

The study finds evidence of emotional contagion in soicial networks among English language Facebook users in 2012. The estimated effects sizes are tiny (Cohen’s d ~ 0.02. Read more about Cohen’s d). However, the effect is potentially still quite meaningful and substantively important because the manipulation was itself quite small in scope (the scale of the study notwithstanding). There estimates may contain unobserved biased due to the construction of the sample, but overall this is a landmark study demonstrating the existence of an infrequently observed phenomenon (emotional contagion) in a context dominated by large numbers of short computer-mediated communications.