For this exercise, please try to reproduce the results from Experiment 6 of the associated paper (Shah, Shafir, & Mullainathan, 2015). The PDF of the paper is included in the same folder as this Rmd file.
The authors were interested in the effect of scarcity on people’s consistency of valuation judgments. In this study, participants played a game of Family Feud and were given either 75 s (budget - “poor” condition) or 250 s (budget - “rich” condition) to complete the game. After playing the game, participants were either primed to think about a small account of time necessary to play one round of the game (account -“small” condition) or a large account (their overall time budget to play the entire game, account - “large” condition.) Participants rated how costly it would feel to lose 10s of time to play the game. The researchers were primarily interested in an interaction between the between-subjects factors of scarcity and account, hypothesizing that those in the budget - “poor” condition would be more consistent in their valuation of the 10s regardless of account in comparison with those in the budget - “rich” condition. The authors tested this hypothesis with a 2x2 between-subjects ANOVA.
Below is the specific result you will attempt to reproduce (quoted directly from the results section of Experiment 6):
“One participant was excluded because of a computer malfunction during the game. Time-rich participants rated the loss as more expensive when they thought about a small account (M = 8.31, 95% CI = [7.78, 8.84]) than when they thought about a large account (M = 6.50, 95% CI = [5.42, 7.58]), whereas time-poor participants’ evaluations did not differ between the small-account condition (M = 8.33, 95% CI = [7.14, 9.52]) and the large account condition (M = 8.83, 95% CI = [7.97, 9.69]). A 2 (scarcity condition) × 2 (account condition) analysis of variance revealed a significant interaction, F(1, 69) = 5.16, p < .05, ηp2 = .07.” (Shah, Shafir & Mullainathan, 2015) ——
library(tidyverse) # for data munging
library(knitr) # for kable table formating
library(haven) # import and export 'SPSS', 'Stata' and 'SAS' Files
library(readxl) # import excel files
# #optional packages:
# library(afex) #anova functions
# library(langcog) #95 percent confidence intervals
# Just Experiment 6
data <- read_excel("data/study 6-accessible-feud.xlsx")
The data are already tidy as provided by the authors.
One participant was excluded because of a computer malfunction during the game (Shah, Shafir, & Mullainathan, 2015, p. 408)
Note: The original paper does not identify the participant that was excluded, but it was later revealed through communication with the authors that it was participant #16. The exclusion is performed below.
# Participant #16 should be dropped from analysis
excluded <- "16"
d <- data %>%
filter(!Subject %in% excluded) #participant exclusions
Time-rich participants rated the loss as more expensive when they thought about a small account (M = 8.31, 95% CI = [7.78, 8.84]) than when they thought about a large account (M = 6.50, 95% CI = [5.42, 7.58]), whereas time-poor participants’ evaluations did not differ between the small-account condition (M = 8.33, 95% CI = [7.14, 9.52]) and the large- account condition (M = 8.83, 95% CI = [7.97, 9.69]). (Shah, Shafir, & Mullainathan, 2015, p. 408)
# reproduce the above results here
# Slack = budget
# Large = account
alpha = 0.05
degrees.freedom = 74
#Loss rating of time rich participants thinking about small account
#(Slack == 1, Large = 0, Cond = 1)
#16
cond_1 <- data %>%
filter(Cond == 1)
cond1_mean <- mean(cond_1$expense)
cond1_sd <- sd(cond_1$expense)
cond1_se <- cond1_sd/sqrt(16)
t.score1 = qt(p=alpha/2, df=degrees.freedom,lower.tail=F)
margin.error1 <- t.score1 * cond1_se
lower.bound1 <- cond1_mean - margin.error1
upper.bound1 <- cond1_mean + margin.error1
print(c(cond1_mean))
## [1] 8.3125
print(c(lower.bound1,upper.bound1))
## [1] 7.775413 8.849587
#Loss rating of time rich participants thinking about large account
#(Slack == 1, Large = 1, Cond = 3)
#18
cond_3 <- data %>%
filter(Cond == 3)
cond3_mean <- mean(cond_3$expense)
cond3_sd <- sd(cond_3$expense)
cond3_se <- cond3_sd/sqrt(18)
t.score3 = qt(p=alpha/2, df=degrees.freedom,lower.tail=F)
margin.error3 <- t.score3 * cond3_se
lower.bound3 <- cond3_mean - margin.error3
upper.bound3 <- cond3_mean + margin.error3
print(c(cond3_mean))
## [1] 6.5
print(c(lower.bound3,upper.bound3))
## [1] 5.404486 7.595514
#Loss rating of time poor participants thinking about small account
#(Slack == 0, Large = 0, Cond = 0)
#21
cond_0 <- data %>%
filter(Cond == 0)
cond0_mean <- mean(cond_0$expense)
cond0_sd <- sd(cond_0$expense)
cond0_se <- cond0_sd/sqrt(21)
t.score0 = qt(p=alpha/2, df=degrees.freedom,lower.tail=F)
margin.error0 <- t.score0 * cond0_se
lower.bound0 <- cond0_mean - margin.error0
upper.bound0 <- cond0_mean + margin.error0
print(c(cond0_mean))
## [1] 8.333333
print(c(lower.bound0,upper.bound0))
## [1] 7.124180 9.542487
#Loss rating of time poor participants thinking about large account
#(Slack == 0, Large = 1, Cond = 2)
#19
cond_2 <- data %>%
filter(Cond == 2)
cond2_mean <- mean(cond_2$expense)
cond2_sd <- sd(cond_2$expense)
cond2_se <- cond2_sd/sqrt(19)
t.score2 = qt(p=alpha/2, df=degrees.freedom,lower.tail=F)
margin.error2 <- t.score2 * cond2_se
lower.bound2 <- cond2_mean - margin.error2
upper.bound2 <- cond2_mean + margin.error2
print(c(cond2_mean))
## [1] 8.947368
print(c(lower.bound2,upper.bound2))
## [1] 8.092531 9.802206
A 2 (scarcity condition) × 2 (account condition) analysis of variance revealed a significant interaction, F(1, 69) = 5.16, p < .05, ηp2 = .07.
data$Large <- as.factor(data$Large)
data$Slack <- as.factor(data$Slack)
result <- aov(expense ~ Large + Slack, data = data)
summary(result)
## Df Sum Sq Mean Sq F value Pr(>F)
## Large 1 6.0 5.959 1.193 0.2783
## Slack 1 28.4 28.396 5.687 0.0198 *
## Residuals 71 354.5 4.993
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
result1 <- aov(expense ~ Large * Slack, data = data)
summary(result1)
## Df Sum Sq Mean Sq F value Pr(>F)
## Large 1 6.0 5.959 1.274 0.2629
## Slack 1 28.4 28.396 6.068 0.0162 *
## Large:Slack 1 27.0 26.972 5.764 0.0190 *
## Residuals 70 327.6 4.679
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Were you able to reproduce the results you attempted to reproduce? If not, what part(s) were you unable to reproduce?
I was able to reproduce the means and confidence intervals (although I noticed the mean for the condition 0 is off and I’m not sure why that is, and that threw off the SD and consequent numbers as well). I also attempted the 2x2 ANOVA, which did show that slack and the interaction of large and slack are significant on expense numbers, however I didn’t get quite the same numbers as the study.
How difficult was it to reproduce your results?
It was not too bad, but definitely took time to understand what the data meant and how to extract what we want from the data.
What aspects made it difficult? What aspects made it easy?
Finding the mean was not bad, but the rest was a learning curve. It was difficult to learn to find confidence interval, and then also trying to understand the ANOVA results.