Supplementary R code for

Wickelmaier, F. (2015). On not testing the foreign-language effect: A comment on Costa, Foucart, Arnon, Aparici, and Apesteguia (2014). ArXiv e-prints, https://arxiv.org/abs/1506.07727.

Data taken from Costa et al. (2014), Cognition 130(2), 236-254.

## Asian disease (Spanish/English)
dat1 <- read.table(header=TRUE, text="
  lang frame sure risky
    NL  gain   42    20
    NL  loss   21    41
    FL  gain   41    20
    FL  loss   31    31
")
dat1$frame <- factor(dat1$frame, levels=c("loss", "gain"))
glm1 <- glm(cbind(sure, risky) ~ frame*lang, binomial, dat1)

## Asian disease (Arab/Hebrew)
dat2 <- read.table(header=TRUE, text="
  lang frame sure risky
    NL  gain   26     8
    NL  loss   15    20
    FL  gain   22     8
    FL  loss   19    11
")
dat2$frame <- factor(dat2$frame, levels=c("loss", "gain"))
glm2 <- glm(cbind(sure, risky) ~ frame*lang, binomial, dat2)

## Financial crisis
dat3 <- read.table(header=TRUE, text="
  lang frame sure risky
    NL  gain   49    20
    NL  loss   40    31
    FL  gain   47    23
    FL  loss   43    27
")
dat3$frame <- factor(dat3$frame, levels=c("loss", "gain"))
glm3 <- glm(cbind(sure, risky) ~ frame*lang, binomial, dat3)

## Ticket/money lost
dat4 <- read.table(header=TRUE, text="
  lang  frame pos neg
    NL  money  30  40
    NL ticket  17  53
    FL  money  37  33
    FL ticket  23  47
")
dat4$frame <- factor(dat4$frame, levels=c("ticket", "money"))
glm4 <- glm(cbind(pos, neg) ~ frame*lang, binomial, dat4)

## Discount
dat5 <- read.table(header=TRUE, text="
  lang  frame pos neg
    NL  dis15  27  44
    NL dis125   7  64
    FL  dis15  32  38  # typo in Costa et al. (2014, Tab. 3)
    FL dis125  22  48
")
glm5 <- glm(cbind(pos, neg) ~ frame*lang, binomial, dat5)

## Odds ratios, ratio of odds ratios, and 95% confidence interval
coefs <- t(sapply(list(glm1, glm2, glm3, glm4, glm5),
                  function(i) coef(i)))
exp(cbind(or.nl=coefs[, 2] + coefs[, 4], or.fl=coefs[, 2], ratio=coefs[, 4]))
##         or.nl    or.fl    ratio
## [1,] 4.100000 2.050000 2.000000
## [2,] 4.333333 1.592105 2.721763
## [3,] 1.898750 1.283114 1.479798
## [4,] 2.338235 2.291173 1.020541
## [5,] 5.610390 1.837321 3.053571
t(sapply(list(glm1, glm2, glm3, glm4, glm5),
         function(i) exp(confint(i)[4, ])))
##          2.5 %    97.5 %
## [1,] 0.7041469  5.724335
## [2,] 0.6015326 12.527957
## [3,] 0.5530313  3.981134
## [4,] 0.3772570  2.774676
## [5,] 0.9966677 10.029017
## Combined analysis, first three studies
dat1$study <- "A"; dat2$study <- "B"; dat3$study <- "C"
dat <- rbind(dat1, dat2, dat3)
glm.c <- glm(cbind(sure, risky) ~ frame*lang + frame*study + lang*study,
             binomial, dat)
exp(cbind(coef(glm.c), confint(glm.c)))["framegain:langNL", ]
##               2.5 %    97.5 % 
## 1.8589877 0.9731583 3.5605127