read data

d<- read.csv("pun_dat.csv" , header = T, na.strings = ".")

create condition codes

d$cost_con <- NA
d$cost_con[d$chooserandom_1 == 1] <- "no"
d$cost_con[d$chooserandom_1 == 2] <- "no"
d$cost_con[d$chooserandom_1 == 3] <- "low"
d$cost_con[d$chooserandom_1 == 4] <- "low"
d$cost_con[d$chooserandom_1 == 5] <- "high"
d$cost_con[d$chooserandom_1 == 6] <- "high"

d$con <- NA
d$con[d$chooserandom_1 == 1] <- "no real"
d$con[d$chooserandom_1 == 2] <- "no hypo"
d$con[d$chooserandom_1 == 3] <- "low real"
d$con[d$chooserandom_1 == 4] <- "low hypo"
d$con[d$chooserandom_1 == 5] <- "high real"
d$con[d$chooserandom_1 == 6] <- "high hypo"

d$real_con[d$chooserandom_1 == 1] <- "real"
d$real_con[d$chooserandom_1 == 2] <- "hypo"
d$real_con[d$chooserandom_1 == 3] <- "real"
d$real_con[d$chooserandom_1 == 4] <- "hypo"
d$real_con[d$chooserandom_1 == 5] <- "real"
d$real_con[d$chooserandom_1 == 6] <- "hypo"

combine outcomes for all conditions

# punishment dollar amount outcome 
d$pun = rowSums(subset(d, select = c(no_costXhypo_punish_amount_1, no_costXreal_punish_amount_1, low_costXhypo_punish_amount_1, low_costXreal_punish_amount_1, high_costXhypo_punish_amount_1, high_costXreal_punish_amount_1)), na.rm = T)

d$die = rowSums(subset(d, select = c(no_costXreal_die_instruction2_1, no_costXhypo_die_instruction2_1, low_costXhypo_die_instruction2_1, low_costXreal_die_instruction2_1, high_costXhypo_die_instruction2_1, high_costXreal_die_instruction2_1)), na.rm = T)


## emotion scales 
d$anger = rowMeans(subset(d, select = c(emotions_4, emotions_8, emotions_12)))
d$envy = rowMeans(subset(d, select = c(emotions_7, emotions_11)))

intial descriptives

describe.by(d$pun, group = d$chooserandom_1)
## Warning: describe.by is deprecated.  Please use the describeBy function
## 
##  Descriptive statistics by group 
## group: 1
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 75 3.13 3.14      2     2.7 2.97   0  10    10 0.86    -0.26 0.36
## ------------------------------------------------------------ 
## group: 2
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 52 3.88 3.54    3.5    3.62 3.71   0  10    10 0.52    -1.02 0.49
## ------------------------------------------------------------ 
## group: 3
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 60 2.12 2.53    1.5    1.71 2.22   0  10    10 1.22     1.07 0.33
## ------------------------------------------------------------ 
## group: 4
##    vars  n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 60 1.35 2.16      0    0.88   0   0  10    10  1.9      3.7 0.28
## ------------------------------------------------------------ 
## group: 5
##    vars  n mean  sd median trimmed mad min max range skew kurtosis   se
## X1    1 54 1.41 2.3      0    0.93   0   0  10    10 2.16     4.82 0.31
## ------------------------------------------------------------ 
## group: 6
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 49 2.39 3.01      1     1.9 1.48   0  10    10 1.11     0.29 0.43
describeBy(d$pun, group = d$con)
## 
##  Descriptive statistics by group 
## group: high hypo
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 49 2.39 3.01      1     1.9 1.48   0  10    10 1.11     0.29 0.43
## ------------------------------------------------------------ 
## group: high real
##    vars  n mean  sd median trimmed mad min max range skew kurtosis   se
## X1    1 54 1.41 2.3      0    0.93   0   0  10    10 2.16     4.82 0.31
## ------------------------------------------------------------ 
## group: low hypo
##    vars  n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 60 1.35 2.16      0    0.88   0   0  10    10  1.9      3.7 0.28
## ------------------------------------------------------------ 
## group: low real
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 60 2.12 2.53    1.5    1.71 2.22   0  10    10 1.22     1.07 0.33
## ------------------------------------------------------------ 
## group: no hypo
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 52 3.88 3.54    3.5    3.62 3.71   0  10    10 0.52    -1.02 0.49
## ------------------------------------------------------------ 
## group: no real
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 75 3.13 3.14      2     2.7 2.97   0  10    10 0.86    -0.26 0.36
t.test(d$pun[d$real_con=="real"], d$pun[d$real_con=="hypo"], var.equal = T)
## 
##  Two Sample t-test
## 
## data:  d$pun[d$real_con == "real"] and d$pun[d$real_con == "hypo"]
## t = -0.52904, df = 348, p-value = 0.5971
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.7879053  0.4538818
## sample estimates:
## mean of x mean of y 
##  2.317460  2.484472
hist(d$pun)

descriptives

describeBy(d$pun, list(d$cost_con, d$real_con))
## 
##  Descriptive statistics by group 
## : high
## : hypo
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 49 2.39 3.01      1     1.9 1.48   0  10    10 1.11     0.29 0.43
## ------------------------------------------------------------ 
## : low
## : hypo
##    vars  n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 60 1.35 2.16      0    0.88   0   0  10    10  1.9      3.7 0.28
## ------------------------------------------------------------ 
## : no
## : hypo
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 52 3.88 3.54    3.5    3.62 3.71   0  10    10 0.52    -1.02 0.49
## ------------------------------------------------------------ 
## : high
## : real
##    vars  n mean  sd median trimmed mad min max range skew kurtosis   se
## X1    1 54 1.41 2.3      0    0.93   0   0  10    10 2.16     4.82 0.31
## ------------------------------------------------------------ 
## : low
## : real
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 60 2.12 2.53    1.5    1.71 2.22   0  10    10 1.22     1.07 0.33
## ------------------------------------------------------------ 
## : no
## : real
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 75 3.13 3.14      2     2.7 2.97   0  10    10 0.86    -0.26 0.36
describeBy(d$pun, group = list(d$cost_con, d$real_con))
## 
##  Descriptive statistics by group 
## : high
## : hypo
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 49 2.39 3.01      1     1.9 1.48   0  10    10 1.11     0.29 0.43
## ------------------------------------------------------------ 
## : low
## : hypo
##    vars  n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 60 1.35 2.16      0    0.88   0   0  10    10  1.9      3.7 0.28
## ------------------------------------------------------------ 
## : no
## : hypo
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 52 3.88 3.54    3.5    3.62 3.71   0  10    10 0.52    -1.02 0.49
## ------------------------------------------------------------ 
## : high
## : real
##    vars  n mean  sd median trimmed mad min max range skew kurtosis   se
## X1    1 54 1.41 2.3      0    0.93   0   0  10    10 2.16     4.82 0.31
## ------------------------------------------------------------ 
## : low
## : real
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 60 2.12 2.53    1.5    1.71 2.22   0  10    10 1.22     1.07 0.33
## ------------------------------------------------------------ 
## : no
## : real
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 75 3.13 3.14      2     2.7 2.97   0  10    10 0.86    -0.26 0.36
describeBy(d$pun, group = d$con)
## 
##  Descriptive statistics by group 
## group: high hypo
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 49 2.39 3.01      1     1.9 1.48   0  10    10 1.11     0.29 0.43
## ------------------------------------------------------------ 
## group: high real
##    vars  n mean  sd median trimmed mad min max range skew kurtosis   se
## X1    1 54 1.41 2.3      0    0.93   0   0  10    10 2.16     4.82 0.31
## ------------------------------------------------------------ 
## group: low hypo
##    vars  n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 60 1.35 2.16      0    0.88   0   0  10    10  1.9      3.7 0.28
## ------------------------------------------------------------ 
## group: low real
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 60 2.12 2.53    1.5    1.71 2.22   0  10    10 1.22     1.07 0.33
## ------------------------------------------------------------ 
## group: no hypo
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 52 3.88 3.54    3.5    3.62 3.71   0  10    10 0.52    -1.02 0.49
## ------------------------------------------------------------ 
## group: no real
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 75 3.13 3.14      2     2.7 2.97   0  10    10 0.86    -0.26 0.36

Contrast codes

set 1

#HypoVsReal
d$HypoVsReal<- ((-(1/2))*(d$con == "no hypo")) + ((1/2)*(d$con == "no real"))+(-(1/2))*(d$con == "low hypo") + ((1/2)*(d$con == "low real")) +((-(1/2))*(d$con == "high hypo")) + ((1/2)*(d$con == "high real"))

#no cost vs some cost
d$noVsother<- (((2/3))*(d$con == "no hypo")) + ((2/3)*(d$con == "no real"))+(-(1/3))*(d$con == "low hypo") + (-(1/3)*(d$con == "low real")) +((-(1/3))*(d$con == "high hypo")) + ((-(1/3))*(d$con == "high real"))

d$Highvslow <- (0*(d$con == "no hypo")) + ((0)*(d$con == "no real"))+((1/2))*(d$con == "low hypo") + ((1/2)*(d$con == "low real")) +((-1/2)*(d$con == "high hypo")) + ((-1/2)*(d$con == "high real"))

set 2

#high cost vs othe cost
d$highVsother<- (((-1/3))*(d$con == "no hypo")) + ((-1/3)*(d$con == "no real"))+(-(1/3))*(d$con == "low hypo") + (-(1/3)*(d$con == "low real")) +((2/3)*(d$con == "high hypo")) + ((2/3)*(d$con == "high real"))

#low vs no cost
d$novslow <- ((1/2)*(d$con == "no hypo")) + ((1/2)*(d$con == "no real"))+((-1/2))*(d$con == "low hypo") + ((-1/2)*(d$con == "low real")) +((0)*(d$con == "high hypo")) + ((0)*(d$con == "high real"))

set 3

#high cost vs othe cost
d$lowVsother<- (((-1/3))*(d$con == "no hypo")) + ((-1/3)*(d$con == "no real"))+(2/3)*(d$con == "low hypo") + ((2/3)*(d$con == "low real")) +((-1/3)*(d$con == "high hypo")) + ((-1/3)*(d$con == "high real"))

#low vs no cost
d$highvsno <- ((1/2)*(d$con == "no hypo")) + ((1/2)*(d$con == "no real"))+((0))*(d$con == "low hypo") + ((0)*(d$con == "low real")) +((-1/2)*(d$con == "high hypo")) + ((-1/3)*(d$con == "high real"))

Dummy codes

real vs hypo

#Hypo dummy
d$Hypodum<- ((0)*(d$con == "no hypo")) + ((1)*(d$con == "no real"))+((0)*(d$con == "low hypo")) + ((1)*(d$con == "low real")) +((0)*(d$con == "high hypo")) + ((1)*(d$con == "high real"))

# real dummy
d$Realdum<- ((1)*(d$con == "no hypo")) + ((0)*(d$con == "no real"))+((1)*(d$con == "low hypo")) + ((0)*(d$con == "low real")) +((1)*(d$con == "high hypo")) + ((0)*(d$con == "high real"))

cost dummy

#no cost dummy
d$nodum<- ((0)*(d$con == "no hypo")) + ((0)*(d$con == "no real"))+((1)*(d$con == "low hypo")) + ((1)*(d$con == "low real")) +((1)*(d$con == "high hypo")) + ((1)*(d$con == "high real"))
d$hypo_nodum_int <- d$HypoVsReal*d$nodum
d$hypo_hvl_int <- d$HypoVsReal*d$Highvslow

#low dum
d$lowdum<- ((1)*(d$con == "no hypo")) + ((1)*(d$con == "no real"))+((0)*(d$con == "low hypo")) + ((0)*(d$con == "low real")) +((1)*(d$con == "high hypo")) + ((1)*(d$con == "high real"))

# high dum
d$highdum<- ((1)*(d$con == "no hypo")) + ((1)*(d$con == "no real"))+((1)*(d$con == "low hypo")) + ((1)*(d$con == "low real")) +((0)*(d$con == "high hypo")) + ((0)*(d$con == "high real"))

d$hypo_highdum_int <- d$HypoVsReal*d$nodum
d$hypo_nvl_int <- d$HypoVsReal*d$Highvslow
d$punplus[d$pun >= .001 ] <- 1
d$punplus[d$pun <= 0] <- 0

Main models - $ amount punishment

#hypo vs real by no cost vs other costs/ high vs low cost
m1 <- lm(d$pun ~ (d$HypoVsReal)*(d$noVsother + d$Highvslow))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$HypoVsReal) * (d$noVsother + d$Highvslow))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                2.3800     0.1522  15.632  < 2e-16 ***
## d$HypoVsReal              -0.3217     0.3045  -1.056   0.2916    
## d$noVsother                1.6935     0.3174   5.335 1.74e-07 ***
## d$Highvslow               -0.1642     0.3792  -0.433   0.6652    
## d$HypoVsReal:d$noVsother  -0.6444     0.6349  -1.015   0.3108    
## d$HypoVsReal:d$Highvslow   1.7470     0.7584   2.303   0.0219 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06
#hypo vs real by no cost vs low cost/ high vs other cost
m1 <- lm(d$pun ~ (d$HypoVsReal)*(d$novslow + d$highVsother))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$HypoVsReal) * (d$novslow + d$highVsother))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                            Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  2.3800     0.1522  15.632  < 2e-16 ***
## d$HypoVsReal                -0.3217     0.3045  -1.056   0.2916    
## d$novslow                    1.7756     0.3621   4.903 1.46e-06 ***
## d$highVsother               -0.7236     0.3321  -2.179   0.0300 *  
## d$HypoVsReal:d$novslow      -1.5179     0.7243  -2.096   0.0368 *  
## d$HypoVsReal:d$highVsother  -0.9880     0.6641  -1.488   0.1377    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06
#hypo vs real by high cost vs no costs/ other vs low cost
m1 <- lm(d$pun ~ (d$HypoVsReal)*(d$highvsno + d$lowVsother))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$HypoVsReal) * (d$highvsno + d$lowVsother))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.3224     0.1547  15.016  < 2e-16 ***
## d$HypoVsReal               -0.4367     0.3093  -1.412  0.15890    
## d$highvsno                  1.7840     0.4125   4.325    2e-05 ***
## d$lowVsother               -0.8836     0.3218  -2.746  0.00636 ** 
## d$HypoVsReal:d$highvsno     0.5743     0.8250   0.696  0.48688    
## d$HypoVsReal:d$lowVsother   1.8051     0.6437   2.804  0.00533 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06

main models + emotions

#difference in anger by hypo vs real by no cost vs other costs/ high vs low cost
m1 <- lm(d$anger ~ (d$HypoVsReal)*(d$noVsother + d$Highvslow))
summary(m1)
## 
## Call:
## lm(formula = d$anger ~ (d$HypoVsReal) * (d$noVsother + d$Highvslow))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.2901 -1.2444  0.5167  0.8500  3.7556 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)               3.202936   0.073986  43.291   <2e-16 ***
## d$HypoVsReal              0.101617   0.147973   0.687    0.493    
## d$noVsother               0.029057   0.154256   0.188    0.851    
## d$Highvslow               0.007943   0.184286   0.043    0.966    
## d$HypoVsReal:d$noVsother -0.139348   0.308513  -0.452    0.652    
## d$HypoVsReal:d$Highvslow -0.107244   0.368572  -0.291    0.771    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.371 on 344 degrees of freedom
## Multiple R-squared:  0.002123,   Adjusted R-squared:  -0.01238 
## F-statistic: 0.1464 on 5 and 344 DF,  p-value: 0.981
# ANGER for dictator 
m1 <- lm(d$pun ~ (d$HypoVsReal)*(d$noVsother + d$Highvslow)*(d$anger))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$HypoVsReal) * (d$noVsother + d$Highvslow) * 
##     (d$anger))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.9729 -1.9046 -0.7968  1.5027  9.2032 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       1.63094    0.38864   4.196 3.47e-05 ***
## d$HypoVsReal                     -0.40823    0.77729  -0.525   0.5998    
## d$noVsother                       3.17019    0.79816   3.972 8.72e-05 ***
## d$Highvslow                       0.67488    0.98138   0.688   0.4921    
## d$anger                           0.23367    0.11178   2.090   0.0373 *  
## d$HypoVsReal:d$noVsother          0.43881    1.59633   0.275   0.7836    
## d$HypoVsReal:d$Highvslow          2.59738    1.96276   1.323   0.1866    
## d$HypoVsReal:d$anger              0.01446    0.22356   0.065   0.9485    
## d$noVsother:d$anger              -0.45990    0.22824  -2.015   0.0447 *  
## d$Highvslow:d$anger              -0.25994    0.28368  -0.916   0.3602    
## d$HypoVsReal:d$noVsother:d$anger -0.31726    0.45649  -0.695   0.4875    
## d$HypoVsReal:d$Highvslow:d$anger -0.24155    0.56735  -0.426   0.6706    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.811 on 338 degrees of freedom
## Multiple R-squared:  0.1152, Adjusted R-squared:  0.0864 
## F-statistic:     4 on 11 and 338 DF,  p-value: 1.679e-05
#envy for dictator 
m1 <- lm(d$pun ~ (d$HypoVsReal)*(d$noVsother + d$Highvslow)*(d$envy))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$HypoVsReal) * (d$noVsother + d$Highvslow) * 
##     (d$envy))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.614 -1.973 -1.054  1.317  8.595 
## 
## Coefficients:
##                                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      3.04011    0.44029   6.905  2.5e-11 ***
## d$HypoVsReal                    -0.24482    0.88058  -0.278   0.7812    
## d$noVsother                      2.06093    0.91075   2.263   0.0243 *  
## d$Highvslow                     -0.24407    1.10468  -0.221   0.8253    
## d$envy                          -0.20954    0.13629  -1.537   0.1251    
## d$HypoVsReal:d$noVsother         2.98009    1.82151   1.636   0.1028    
## d$HypoVsReal:d$Highvslow         1.76474    2.20935   0.799   0.4250    
## d$HypoVsReal:d$envy             -0.01588    0.27258  -0.058   0.9536    
## d$noVsother:d$envy              -0.09548    0.28505  -0.335   0.7379    
## d$Highvslow:d$envy               0.03747    0.33847   0.111   0.9119    
## d$HypoVsReal:d$noVsother:d$envy -1.16961    0.57010  -2.052   0.0410 *  
## d$HypoVsReal:d$Highvslow:d$envy -0.02836    0.67695  -0.042   0.9666    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.817 on 338 degrees of freedom
## Multiple R-squared:  0.1111, Adjusted R-squared:  0.0822 
## F-statistic: 3.841 on 11 and 338 DF,  p-value: 3.13e-05
#guilt for recipient
m1 <- lm(d$pun ~ (d$HypoVsReal)*(d$noVsother + d$Highvslow)*(d$emotions_control_2))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$HypoVsReal) * (d$noVsother + d$Highvslow) * 
##     (d$emotions_control_2))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.428 -1.882 -0.882  1.587  8.506 
## 
## Coefficients:
##                                                Estimate Std. Error t value
## (Intercept)                                    2.447955   0.440890   5.552
## d$HypoVsReal                                   0.883553   0.881780   1.002
## d$noVsother                                    1.419454   0.921960   1.540
## d$Highvslow                                   -0.007901   1.095107  -0.007
## d$emotions_control_2                          -0.014940   0.097736  -0.153
## d$HypoVsReal:d$noVsother                       0.924472   1.843921   0.501
## d$HypoVsReal:d$Highvslow                       5.362447   2.190214   2.448
## d$HypoVsReal:d$emotions_control_2             -0.285890   0.195472  -1.463
## d$noVsother:d$emotions_control_2               0.062487   0.206249   0.303
## d$Highvslow:d$emotions_control_2              -0.034849   0.240646  -0.145
## d$HypoVsReal:d$noVsother:d$emotions_control_2 -0.382649   0.412497  -0.928
## d$HypoVsReal:d$Highvslow:d$emotions_control_2 -0.844288   0.481292  -1.754
##                                               Pr(>|t|)    
## (Intercept)                                   5.71e-08 ***
## d$HypoVsReal                                    0.3171    
## d$noVsother                                     0.1246    
## d$Highvslow                                     0.9942    
## d$emotions_control_2                            0.8786    
## d$HypoVsReal:d$noVsother                        0.6164    
## d$HypoVsReal:d$Highvslow                        0.0149 *  
## d$HypoVsReal:d$emotions_control_2               0.1445    
## d$noVsother:d$emotions_control_2                0.7621    
## d$Highvslow:d$emotions_control_2                0.8849    
## d$HypoVsReal:d$noVsother:d$emotions_control_2   0.3543    
## d$HypoVsReal:d$Highvslow:d$emotions_control_2   0.0803 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.817 on 338 degrees of freedom
## Multiple R-squared:  0.111,  Adjusted R-squared:  0.08211 
## F-statistic: 3.838 on 11 and 338 DF,  p-value: 3.171e-05
#sad for recipient 
m1 <- lm(d$pun ~ (d$HypoVsReal)*(d$noVsother + d$Highvslow)*(d$emotions_control_6))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$HypoVsReal) * (d$noVsother + d$Highvslow) * 
##     (d$emotions_control_6))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.6459 -2.0729 -0.8074  1.6616  8.4946 
## 
## Coefficients:
##                                               Estimate Std. Error t value
## (Intercept)                                     1.6243     0.4652   3.492
## d$HypoVsReal                                    0.6222     0.9303   0.669
## d$noVsother                                     2.3783     0.9504   2.503
## d$Highvslow                                    -1.3394     1.1799  -1.135
## d$emotions_control_6                            0.1769     0.1034   1.710
## d$HypoVsReal:d$noVsother                        2.1810     1.9007   1.147
## d$HypoVsReal:d$Highvslow                        2.8861     2.3598   1.223
## d$HypoVsReal:d$emotions_control_6              -0.2289     0.2069  -1.107
## d$noVsother:d$emotions_control_6               -0.1532     0.2121  -0.722
## d$Highvslow:d$emotions_control_6                0.2722     0.2615   1.041
## d$HypoVsReal:d$noVsother:d$emotions_control_6  -0.6694     0.4243  -1.578
## d$HypoVsReal:d$Highvslow:d$emotions_control_6  -0.2668     0.5230  -0.510
##                                               Pr(>|t|)    
## (Intercept)                                   0.000543 ***
## d$HypoVsReal                                  0.504052    
## d$noVsother                                   0.012802 *  
## d$Highvslow                                   0.257108    
## d$emotions_control_6                          0.088220 .  
## d$HypoVsReal:d$noVsother                      0.252011    
## d$HypoVsReal:d$Highvslow                      0.222173    
## d$HypoVsReal:d$emotions_control_6             0.269213    
## d$noVsother:d$emotions_control_6              0.470779    
## d$Highvslow:d$emotions_control_6              0.298610    
## d$HypoVsReal:d$noVsother:d$emotions_control_6 0.115553    
## d$HypoVsReal:d$Highvslow:d$emotions_control_6 0.610295    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.809 on 338 degrees of freedom
## Multiple R-squared:  0.1164, Adjusted R-squared:  0.08766 
## F-statistic: 4.048 on 11 and 338 DF,  p-value: 1.391e-05

hypo vs real cost simple effects

# simple effect of hypo vs real for no cost
m1 <- lm(d$pun ~ (d$HypoVsReal *(d$nodum+ d$Highvslow)))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$HypoVsReal * (d$nodum + d$Highvslow)))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                3.5090     0.2546  13.784  < 2e-16 ***
## d$HypoVsReal              -0.7513     0.5091  -1.476   0.1410    
## d$nodum                   -1.6935     0.3174  -5.335 1.74e-07 ***
## d$Highvslow               -0.1642     0.3792  -0.433   0.6652    
## d$HypoVsReal:d$nodum       0.6444     0.6349   1.015   0.3108    
## d$HypoVsReal:d$Highvslow   1.7470     0.7584   2.303   0.0219 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06
# simple effect of hypo vs real for high cost
m1 <- lm(d$pun ~ (d$HypoVsReal *(d$novslow + d$highdum)))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$HypoVsReal * (d$novslow + d$highdum)))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              1.8976     0.2783   6.818 4.17e-11 ***
## d$HypoVsReal            -0.9803     0.5567  -1.761   0.0791 .  
## d$novslow                1.7756     0.3621   4.903 1.46e-06 ***
## d$highdum                0.7236     0.3321   2.179   0.0300 *  
## d$HypoVsReal:d$novslow  -1.5179     0.7243  -2.096   0.0368 *  
## d$HypoVsReal:d$highdum   0.9880     0.6641   1.488   0.1377    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06
# simple effect of hypo vs real for low cost
m1 <- lm(d$pun ~ (d$HypoVsReal *(d$highvsno+ d$lowdum)))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$HypoVsReal * (d$highvsno + d$lowdum)))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)               1.7333     0.2576   6.730 7.12e-11 ***
## d$HypoVsReal              0.7667     0.5151   1.488  0.13759    
## d$highvsno                1.7840     0.4125   4.325 2.00e-05 ***
## d$lowdum                  0.8836     0.3218   2.746  0.00636 ** 
## d$HypoVsReal:d$highvsno   0.5743     0.8250   0.696  0.48688    
## d$HypoVsReal:d$lowdum    -1.8051     0.6437  -2.804  0.00533 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06

cost simple effects

## no cost vs other - simple effect
# hypo dummy
m1 <- lm(d$pun ~ (d$Hypodum *(d$noVsother + d$Highvslow)))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$Hypodum * (d$noVsother + d$Highvslow)))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             2.5408     0.2232  11.385  < 2e-16 ***
## d$Hypodum              -0.3217     0.3045  -1.056   0.2916    
## d$noVsother             2.0157     0.4763   4.232 2.98e-05 ***
## d$Highvslow            -1.0378     0.5433  -1.910   0.0569 .  
## d$Hypodum:d$noVsother  -0.6444     0.6349  -1.015   0.3108    
## d$Hypodum:d$Highvslow   1.7470     0.7584   2.303   0.0219 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06
#real dummy
m1 <- lm(d$pun ~ (d$Realdum *(d$noVsother + d$Highvslow)))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$Realdum * (d$noVsother + d$Highvslow)))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             2.2191     0.2072  10.712   <2e-16 ***
## d$Realdum               0.3217     0.3045   1.056   0.2916    
## d$noVsother             1.3713     0.4197   3.267   0.0012 ** 
## d$Highvslow             0.7093     0.5292   1.340   0.1811    
## d$Realdum:d$noVsother   0.6444     0.6349   1.015   0.3108    
## d$Realdum:d$Highvslow  -1.7470     0.7584  -2.303   0.0219 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06
#high cost vs other
# hypo dummy
m1 <- lm(d$pun ~ (d$Hypodum)*(d$novslow + d$highVsother))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$Hypodum) * (d$novslow + d$highVsother))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)               2.5408     0.2232  11.385  < 2e-16 ***
## d$Hypodum                -0.3217     0.3045  -1.056   0.2916    
## d$novslow                 2.5346     0.5346   4.741 3.11e-06 ***
## d$highVsother            -0.2296     0.4836  -0.475   0.6353    
## d$Hypodum:d$novslow      -1.5179     0.7243  -2.096   0.0368 *  
## d$Hypodum:d$highVsother  -0.9880     0.6641  -1.488   0.1377    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06
#real dummy
m1 <- lm(d$pun ~ (d$Realdum)*(d$novslow + d$highVsother))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$Realdum) * (d$novslow + d$highVsother))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)               2.2191     0.2072  10.712  < 2e-16 ***
## d$Realdum                 0.3217     0.3045   1.056  0.29155    
## d$novslow                 1.0167     0.4887   2.080  0.03823 *  
## d$highVsother            -1.2176     0.4551  -2.675  0.00782 ** 
## d$Realdum:d$novslow       1.5179     0.7243   2.096  0.03683 *  
## d$Realdum:d$highVsother   0.9880     0.6641   1.488  0.13772    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06
## low cost vs other
# hypo dummy
m1 <- lm(d$pun ~ (d$Hypodum)*(d$highvsno + d$lowVsother))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$Hypodum) * (d$highvsno + d$lowVsother))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              2.5408     0.2232  11.385  < 2e-16 ***
## d$Hypodum               -0.4367     0.3093  -1.412 0.158899    
## d$highvsno               1.4969     0.5617   2.665 0.008069 ** 
## d$lowVsother            -1.7862     0.4600  -3.883 0.000124 ***
## d$Hypodum:d$highvsno     0.5743     0.8250   0.696 0.486879    
## d$Hypodum:d$lowVsother   1.8051     0.6437   2.804 0.005328 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06
#real dummy
m1 <- lm(d$pun ~ (d$Realdum)*(d$highvsno + d$lowVsother))
summary(m1)
## 
## Call:
## lm(formula = d$pun ~ (d$Realdum) * (d$highvsno + d$lowVsother))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.117 -1.133  1.641  8.650 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             2.10407    0.21419   9.823  < 2e-16 ***
## d$Realdum               0.43672    0.30932   1.412 0.158899    
## d$highvsno              2.07111    0.60426   3.428 0.000683 ***
## d$lowVsother            0.01889    0.45026   0.042 0.966562    
## d$Realdum:d$highvsno   -0.57425    0.82504  -0.696 0.486879    
## d$Realdum:d$lowVsother -1.80507    0.64366  -2.804 0.005328 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.821 on 344 degrees of freedom
## Multiple R-squared:  0.09249,    Adjusted R-squared:  0.0793 
## F-statistic: 7.012 on 5 and 344 DF,  p-value: 2.951e-06

descriptives for punishment over 1 probability

describeBy(d$punplus, group = d$con)
## 
##  Descriptive statistics by group 
## group: high hypo
##    vars  n mean  sd median trimmed mad min max range  skew kurtosis   se
## X1    1 49 0.53 0.5      1    0.54   0   0   1     1 -0.12    -2.03 0.07
## ------------------------------------------------------------ 
## group: high real
##    vars  n mean  sd median trimmed mad min max range skew kurtosis   se
## X1    1 54 0.44 0.5      0    0.43   0   0   1     1 0.22    -1.99 0.07
## ------------------------------------------------------------ 
## group: low hypo
##    vars  n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 60  0.4 0.49      0    0.38   0   0   1     1  0.4    -1.87 0.06
## ------------------------------------------------------------ 
## group: low real
##    vars  n mean  sd median trimmed mad min max range  skew kurtosis   se
## X1    1 60 0.57 0.5      1    0.58   0   0   1     1 -0.26    -1.96 0.06
## ------------------------------------------------------------ 
## group: no hypo
##    vars  n mean   sd median trimmed mad min max range  skew kurtosis   se
## X1    1 52 0.73 0.45      1    0.79   0   0   1     1 -1.01       -1 0.06
## ------------------------------------------------------------ 
## group: no real
##    vars  n mean   sd median trimmed mad min max range  skew kurtosis   se
## X1    1 75 0.72 0.45      1    0.77   0   0   1     1 -0.96    -1.09 0.05

probability models of punishing at all

logit.cost <- glm(d$punplus ~ (HypoVsReal)*(noVsother + Highvslow), data = d, family=binomial)
summary(logit.cost)
## 
## Call:
## glm(formula = d$punplus ~ (HypoVsReal) * (noVsother + Highvslow), 
##     family = binomial, data = d)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.620  -1.084   0.792   1.066   1.354  
## 
## Coefficients:
##                      Estimate Std. Error z value Pr(>|z|)    
## (Intercept)           0.28421    0.11281   2.519   0.0118 *  
## HypoVsReal            0.09131    0.22562   0.405   0.6857    
## noVsother             1.03093    0.24364   4.231 2.32e-05 ***
## Highvslow            -0.01833    0.27123  -0.068   0.9461    
## HypoVsReal:noVsother -0.21806    0.48728  -0.447   0.6545    
## HypoVsReal:Highvslow  1.01947    0.54246   1.879   0.0602 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 478.04  on 349  degrees of freedom
## Residual deviance: 454.33  on 344  degrees of freedom
## AIC: 466.33
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.cost))
##          (Intercept)           HypoVsReal            noVsother 
##            1.3287093            1.0956035            2.8036743 
##            Highvslow HypoVsReal:noVsother HypoVsReal:Highvslow 
##            0.9818370            0.8040781            2.7717391
logit.cost <- glm(d$punplus ~ (HypoVsReal)*(novslow + highVsother), data = d, family=binomial)
summary(logit.cost)
## 
## Call:
## glm(formula = d$punplus ~ (HypoVsReal) * (novslow + highVsother), 
##     family = binomial, data = d)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.620  -1.084   0.792   1.066   1.354  
## 
## Coefficients:
##                        Estimate Std. Error z value Pr(>|z|)    
## (Intercept)             0.28421    0.11281   2.519  0.01176 *  
## HypoVsReal              0.09131    0.22562   0.405  0.68571    
## novslow                 1.04010    0.27441   3.790  0.00015 ***
## highVsother            -0.50172    0.24096  -2.082  0.03732 *  
## HypoVsReal:novslow     -0.72780    0.54882  -1.326  0.18480    
## HypoVsReal:highVsother -0.65558    0.48191  -1.360  0.17371    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 478.04  on 349  degrees of freedom
## Residual deviance: 454.33  on 344  degrees of freedom
## AIC: 466.33
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.cost))
##            (Intercept)             HypoVsReal                novslow 
##              1.3287093              1.0956035              2.8294880 
##            highVsother     HypoVsReal:novslow HypoVsReal:highVsother 
##              0.6054896              0.4829721              0.5191425
logit.cost <- glm(d$punplus ~ (HypoVsReal)*(novslow + highVsother), data = d, family=binomial)
summary(logit.cost)
## 
## Call:
## glm(formula = d$punplus ~ (HypoVsReal) * (novslow + highVsother), 
##     family = binomial, data = d)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.620  -1.084   0.792   1.066   1.354  
## 
## Coefficients:
##                        Estimate Std. Error z value Pr(>|z|)    
## (Intercept)             0.28421    0.11281   2.519  0.01176 *  
## HypoVsReal              0.09131    0.22562   0.405  0.68571    
## novslow                 1.04010    0.27441   3.790  0.00015 ***
## highVsother            -0.50172    0.24096  -2.082  0.03732 *  
## HypoVsReal:novslow     -0.72780    0.54882  -1.326  0.18480    
## HypoVsReal:highVsother -0.65558    0.48191  -1.360  0.17371    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 478.04  on 349  degrees of freedom
## Residual deviance: 454.33  on 344  degrees of freedom
## AIC: 466.33
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.cost))
##            (Intercept)             HypoVsReal                novslow 
##              1.3287093              1.0956035              2.8294880 
##            highVsother     HypoVsReal:novslow HypoVsReal:highVsother 
##              0.6054896              0.4829721              0.5191425

graphs $ amount punishment

grouped by real vs. hpyothetical

int.plot <- ggplot(d[!is.na(d$real_con),], aes(x = real_con, y = pun, fill = d$cost_con)) +
  ggtitle("Punishment in dollars") +
  geom_bar(stat = "summary", fun = "mean" , position = position_dodge(.9))+
  stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(.9),fun.args = list(mult = 1), width = .2)

int.plot  + theme(
  # Remove panel border
  panel.border = element_blank(),  
  # Remove panel grid lines
  panel.grid.major = element_blank(),
  panel.grid.minor = element_blank(),
  # Remove panel background
  panel.background = element_blank(),
  # Add axis line
  axis.line = element_line(colour = "grey")
  ) + xlab("Condition" ) + ylab("Dollar Amount punished")+ scale_fill_manual("Punishment cost", values = c("red","gold2", "lightgreen")) + scale_x_discrete(labels = c("Hypotheical", "Real") ) 
## Warning: Use of `d$cost_con` is discouraged.
## ℹ Use `cost_con` instead.
## Use of `d$cost_con` is discouraged.
## ℹ Use `cost_con` instead.

grouped by cost

int.plot <- ggplot(d[!is.na(d$real_con),], aes(x = cost_con, y = pun, fill = d$real_con)) +
  ggtitle("Support for Nuclear Retaliation- Combined Samples") +
  geom_bar(stat = "summary", fun = "mean" , position = position_dodge(.9))+
  stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(.9),fun.args = list(mult = 1), width = .2)

int.plot  + theme(
  # Remove panel border
  panel.border = element_blank(),  
  # Remove panel grid lines
  panel.grid.major = element_blank(),
  panel.grid.minor = element_blank(),
  # Remove panel background
  panel.background = element_blank(),
  # Add axis line
  axis.line = element_line(colour = "grey")
  ) + xlab("Condition" ) + ylab("Dollar Amount punished")+ scale_fill_manual("Punishment cost", values = c("lightpink", "powderblue")) + scale_x_discrete(labels = c("High", "low","no") ) 
## Warning: Use of `d$real_con` is discouraged.
## ℹ Use `real_con` instead.
## Use of `d$real_con` is discouraged.
## ℹ Use `real_con` instead.

### reduced data

df1 <-d[!(d$pun<=0),] 
df2 <-d[(3 > d$chooserandom_1),] 
df3 <-d[(4 < d$chooserandom_1),]
df <- rbind(df2,df3)

Models - probability of punish

logit.1 <- glm(punplus ~ (HypoVsReal)*(noVsother + Highvslow), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = punplus ~ (HypoVsReal) * (noVsother + Highvslow), 
##     family = binomial, data = d)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.620  -1.084   0.792   1.066   1.354  
## 
## Coefficients:
##                      Estimate Std. Error z value Pr(>|z|)    
## (Intercept)           0.28421    0.11281   2.519   0.0118 *  
## HypoVsReal            0.09131    0.22562   0.405   0.6857    
## noVsother             1.03093    0.24364   4.231 2.32e-05 ***
## Highvslow            -0.01833    0.27123  -0.068   0.9461    
## HypoVsReal:noVsother -0.21806    0.48728  -0.447   0.6545    
## HypoVsReal:Highvslow  1.01947    0.54246   1.879   0.0602 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 478.04  on 349  degrees of freedom
## Residual deviance: 454.33  on 344  degrees of freedom
## AIC: 466.33
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##          (Intercept)           HypoVsReal            noVsother 
##            1.3287093            1.0956035            2.8036743 
##            Highvslow HypoVsReal:noVsother HypoVsReal:Highvslow 
##            0.9818370            0.8040781            2.7717391
logit.1 <- glm(punplus ~ (HypoVsReal)*(novslow + highVsother), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = punplus ~ (HypoVsReal) * (novslow + highVsother), 
##     family = binomial, data = d)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.620  -1.084   0.792   1.066   1.354  
## 
## Coefficients:
##                        Estimate Std. Error z value Pr(>|z|)    
## (Intercept)             0.28421    0.11281   2.519  0.01176 *  
## HypoVsReal              0.09131    0.22562   0.405  0.68571    
## novslow                 1.04010    0.27441   3.790  0.00015 ***
## highVsother            -0.50172    0.24096  -2.082  0.03732 *  
## HypoVsReal:novslow     -0.72780    0.54882  -1.326  0.18480    
## HypoVsReal:highVsother -0.65558    0.48191  -1.360  0.17371    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 478.04  on 349  degrees of freedom
## Residual deviance: 454.33  on 344  degrees of freedom
## AIC: 466.33
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##            (Intercept)             HypoVsReal                novslow 
##              1.3287093              1.0956035              2.8294880 
##            highVsother     HypoVsReal:novslow HypoVsReal:highVsother 
##              0.6054896              0.4829721              0.5191425
logit.1 <- glm(punplus ~ (HypoVsReal)*(highvsno + lowVsother), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = punplus ~ (HypoVsReal) * (highvsno + lowVsother), 
##     family = binomial, data = d)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.620  -1.084   0.792   1.066   1.354  
## 
## Coefficients:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)            0.24529    0.11394   2.153 0.031330 *  
## HypoVsReal             0.01346    0.22787   0.059 0.952880    
## highvsno               1.13853    0.30940   3.680 0.000233 ***
## lowVsother            -0.47083    0.23443  -2.008 0.044595 *  
## HypoVsReal:highvsno    0.52520    0.61881   0.849 0.396032    
## HypoVsReal:lowVsother  0.99040    0.46885   2.112 0.034653 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 478.04  on 349  degrees of freedom
## Residual deviance: 454.33  on 344  degrees of freedom
## AIC: 466.33
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##           (Intercept)            HypoVsReal              highvsno 
##             1.2779891             1.0135561             3.1221640 
##            lowVsother   HypoVsReal:highvsno HypoVsReal:lowVsother 
##             0.6244821             1.6907964             2.6923008

Models - probability of die odd die roll

logit.1 <- glm(die ~ (HypoVsReal)*(noVsother + Highvslow), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (noVsother + Highvslow), family = binomial, 
##     data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                      Estimate Std. Error z value Pr(>|z|)  
## (Intercept)           -0.1028     0.1094  -0.940   0.3474  
## HypoVsReal             0.2534     0.2188   1.158   0.2468  
## noVsother              0.1208     0.2272   0.531   0.5951  
## Highvslow              0.6226     0.2735   2.277   0.0228 *
## HypoVsReal:noVsother   0.2484     0.4545   0.547   0.5847  
## HypoVsReal:Highvslow   0.3317     0.5469   0.606   0.5442  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##          (Intercept)           HypoVsReal            noVsother 
##            0.9022982            1.2884237            1.1283685 
##            Highvslow HypoVsReal:noVsother HypoVsReal:Highvslow 
##            1.8637822            1.2819603            1.3933333
logit.1 <- glm(die ~ (HypoVsReal)*(novslow + highVsother), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (novslow + highVsother), family = binomial, 
##     data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                        Estimate Std. Error z value Pr(>|z|)  
## (Intercept)            -0.10281    0.10940  -0.940   0.3474  
## HypoVsReal              0.25342    0.21881   1.158   0.2468  
## novslow                -0.19053    0.25836  -0.737   0.4608  
## highVsother            -0.52734    0.24012  -2.196   0.0281 *
## HypoVsReal:novslow      0.08254    0.51672   0.160   0.8731  
## HypoVsReal:highVsother -0.37297    0.48025  -0.777   0.4374  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##            (Intercept)             HypoVsReal                novslow 
##              0.9022982              1.2884237              0.8265200 
##            highVsother     HypoVsReal:novslow HypoVsReal:highVsother 
##              0.5901714              1.0860431              0.6886863
logit.1 <- glm(die ~ (HypoVsReal)*(d$highvsno + d$lowVsother), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (d$highvsno + d$lowVsother), 
##     family = binomial, data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                         Estimate Std. Error z value Pr(>|z|)  
## (Intercept)              -0.1241     0.1113  -1.115   0.2647  
## HypoVsReal                0.2108     0.2226   0.947   0.3435  
## d$highvsno                0.4960     0.2973   1.668   0.0953 .
## d$lowVsother              0.4385     0.2307   1.901   0.0573 .
## HypoVsReal:d$highvsno     0.5421     0.5946   0.912   0.3620  
## HypoVsReal:d$lowVsother   0.1885     0.4614   0.409   0.6829  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##             (Intercept)              HypoVsReal              d$highvsno 
##               0.8832767               1.2346734               1.6421336 
##            d$lowVsother   HypoVsReal:d$highvsno HypoVsReal:d$lowVsother 
##               1.5504254               1.7195785               1.2074355

descriptives of die roll

describeBy(d$die, group = d$cost_con)
## 
##  Descriptive statistics by group 
## group: high
##    vars   n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 103 0.39 0.49      0    0.36   0   0   1     1 0.45    -1.81 0.05
## ------------------------------------------------------------ 
## group: low
##    vars   n mean  sd median trimmed mad min max range  skew kurtosis   se
## X1    1 120 0.54 0.5      1    0.55   0   0   1     1 -0.17    -1.99 0.05
## ------------------------------------------------------------ 
## group: no
##    vars   n mean  sd median trimmed mad min max range  skew kurtosis   se
## X1    1 127  0.5 0.5      1     0.5   0   0   1     1 -0.02    -2.02 0.04
describeBy(d$die, group = d$real_con)
## 
##  Descriptive statistics by group 
## group: hypo
##    vars   n mean  sd median trimmed mad min max range skew kurtosis   se
## X1    1 161 0.45 0.5      0    0.43   0   0   1     1 0.21    -1.97 0.04
## ------------------------------------------------------------ 
## group: real
##    vars   n mean  sd median trimmed mad min max range  skew kurtosis   se
## X1    1 189 0.51 0.5      1    0.52   0   0   1     1 -0.05    -2.01 0.04
describeBy(d$die, group = d$con)
## 
##  Descriptive statistics by group 
## group: high hypo
##    vars  n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 49 0.39 0.49      0    0.37   0   0   1     1 0.45    -1.84 0.07
## ------------------------------------------------------------ 
## group: high real
##    vars  n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 54 0.39 0.49      0    0.36   0   0   1     1 0.44    -1.84 0.07
## ------------------------------------------------------------ 
## group: low hypo
##    vars  n mean  sd median trimmed  mad min max range skew kurtosis   se
## X1    1 60  0.5 0.5    0.5     0.5 0.74   0   1     1    0    -2.03 0.07
## ------------------------------------------------------------ 
## group: low real
##    vars  n mean  sd median trimmed mad min max range  skew kurtosis   se
## X1    1 60 0.58 0.5      1     0.6   0   0   1     1 -0.33    -1.92 0.06
## ------------------------------------------------------------ 
## group: no hypo
##    vars  n mean  sd median trimmed mad min max range skew kurtosis   se
## X1    1 52 0.44 0.5      0    0.43   0   0   1     1 0.23    -1.99 0.07
## ------------------------------------------------------------ 
## group: no real
##    vars  n mean  sd median trimmed mad min max range  skew kurtosis   se
## X1    1 75 0.55 0.5      1    0.56   0   0   1     1 -0.18    -1.99 0.06

condtion frequencies

# condition frequencies before and after removing non punishers
table(df1$con)
## 
## high hypo high real  low hypo  low real   no hypo   no real 
##        26        24        24        34        38        54
table(d$con)
## 
## high hypo high real  low hypo  low real   no hypo   no real 
##        49        54        60        60        52        75

Excluding nonpunishers Models - probability of die odd die roll

# hypo vs real by no cost vs. other costs/high vs low cost
logit.1 <- glm(die ~ (HypoVsReal)*(noVsother + Highvslow), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (noVsother + Highvslow), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                      Estimate Std. Error z value Pr(>|z|)  
## (Intercept)            0.1265     0.1515   0.835   0.4036  
## HypoVsReal             0.5205     0.3031   1.718   0.0859 .
## noVsother             -0.1714     0.2948  -0.581   0.5610  
## Highvslow              0.8446     0.3995   2.114   0.0345 *
## HypoVsReal:noVsother   0.5384     0.5897   0.913   0.3612  
## HypoVsReal:Highvslow   0.3959     0.7991   0.495   0.6203  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##          (Intercept)           HypoVsReal            noVsother 
##             1.134901             1.682884             0.842474 
##            Highvslow HypoVsReal:noVsother HypoVsReal:Highvslow 
##             2.326989             1.713230             1.485714
# hypo vs real by no cost vs. low cost/high vs other cost
logit.1 <- glm(die ~ (HypoVsReal)*(novslow + highVsother), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (novslow + highVsother), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                        Estimate Std. Error z value Pr(>|z|)  
## (Intercept)              0.1265     0.1515   0.835   0.4036  
## HypoVsReal               0.5205     0.3031   1.718   0.0859 .
## novslow                 -0.5937     0.3540  -1.677   0.0935 .
## highVsother             -0.5477     0.3357  -1.632   0.1027  
## HypoVsReal:novslow       0.3404     0.7079   0.481   0.6306  
## HypoVsReal:highVsother  -0.5661     0.6713  -0.843   0.3991  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##            (Intercept)             HypoVsReal                novslow 
##              1.1349011              1.6828837              0.5522801 
##            highVsother     HypoVsReal:novslow HypoVsReal:highVsother 
##              0.5782638              1.4055556              0.5677285
# hypo vs real by no cost vs. high cost/other vs low cost
logit.1 <- glm(die ~ (HypoVsReal)*(highvsno + lowVsother), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (highvsno + lowVsother), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                       Estimate Std. Error z value Pr(>|z|)  
## (Intercept)            0.10591    0.15567   0.680   0.4963  
## HypoVsReal             0.47924    0.31133   1.539   0.1237  
## highvsno               0.31278    0.39421   0.793   0.4275  
## lowVsother             0.75009    0.33649   2.229   0.0258 *
## HypoVsReal:highvsno    0.86014    0.78842   1.091   0.2753  
## HypoVsReal:lowVsother  0.08964    0.67299   0.133   0.8940  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##           (Intercept)            HypoVsReal              highvsno 
##              1.111723              1.614846              1.367219 
##            lowVsother   HypoVsReal:highvsno HypoVsReal:lowVsother 
##              2.117189              2.363482              1.093775

die roll descriptives after excluding nonpunishers

describeBy(df1$die, group = df1$cost_con)
## 
##  Descriptive statistics by group 
## group: high
##    vars  n mean  sd median trimmed mad min max range skew kurtosis   se
## X1    1 50 0.44 0.5      0    0.42   0   0   1     1 0.23    -1.98 0.07
## ------------------------------------------------------------ 
## group: low
##    vars  n mean   sd median trimmed mad min max range  skew kurtosis   se
## X1    1 58 0.66 0.48      1    0.69   0   0   1     1 -0.64    -1.62 0.06
## ------------------------------------------------------------ 
## group: no
##    vars  n mean  sd median trimmed mad min max range  skew kurtosis   se
## X1    1 92 0.52 0.5      1    0.53   0   0   1     1 -0.09    -2.01 0.05
describeBy(df1$die, group = df1$real_con)
## 
##  Descriptive statistics by group 
## group: hypo
##    vars  n mean  sd median trimmed mad min max range skew kurtosis   se
## X1    1 88 0.45 0.5      0    0.44   0   0   1     1 0.18    -1.99 0.05
## ------------------------------------------------------------ 
## group: real
##    vars   n mean   sd median trimmed mad min max range  skew kurtosis   se
## X1    1 112 0.61 0.49      1    0.63   0   0   1     1 -0.43    -1.83 0.05
describeBy(df1$die, group = df1$con)
## 
##  Descriptive statistics by group 
## group: high hypo
##    vars  n mean  sd median trimmed mad min max range skew kurtosis  se
## X1    1 26 0.42 0.5      0    0.41   0   0   1     1 0.29    -1.99 0.1
## ------------------------------------------------------------ 
## group: high real
##    vars  n mean   sd median trimmed mad min max range skew kurtosis  se
## X1    1 24 0.46 0.51      0    0.45   0   0   1     1 0.16    -2.06 0.1
## ------------------------------------------------------------ 
## group: low hypo
##    vars  n mean  sd median trimmed mad min max range  skew kurtosis  se
## X1    1 24 0.58 0.5      1     0.6   0   0   1     1 -0.32    -1.98 0.1
## ------------------------------------------------------------ 
## group: low real
##    vars  n mean   sd median trimmed mad min max range  skew kurtosis   se
## X1    1 34 0.71 0.46      1    0.75   0   0   1     1 -0.86    -1.29 0.08
## ------------------------------------------------------------ 
## group: no hypo
##    vars  n mean  sd median trimmed mad min max range skew kurtosis   se
## X1    1 38 0.39 0.5      0    0.38   0   0   1     1 0.41    -1.88 0.08
## ------------------------------------------------------------ 
## group: no real
##    vars  n mean   sd median trimmed mad min max range  skew kurtosis   se
## X1    1 54 0.61 0.49      1    0.64   0   0   1     1 -0.44    -1.84 0.07

prob simple effects for cost

## high vs other 
#real dummy
logit.1 <- glm(die ~ (Realdum)*(novslow + highVsother), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Realdum) * (novslow + highVsother), family = binomial, 
##     data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)  
## (Intercept)          0.02390    0.14918   0.160   0.8727  
## Realdum             -0.25342    0.21881  -1.158   0.2468  
## novslow             -0.14926    0.34982  -0.427   0.6696  
## highVsother         -0.71383    0.32942  -2.167   0.0302 *
## Realdum:novslow     -0.08254    0.51672  -0.160   0.8731  
## Realdum:highVsother  0.37297    0.48025   0.777   0.4374  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##         (Intercept)             Realdum             novslow         highVsother 
##           1.0241874           0.7761422           0.8613445           0.4897663 
##     Realdum:novslow Realdum:highVsother 
##           0.9207738           1.4520399
#hypo dummy
logit.1 <- glm(die ~ (Hypodum)*(novslow + highVsother), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Hypodum) * (novslow + highVsother), family = binomial, 
##     data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)
## (Intercept)         -0.22952    0.16007  -1.434    0.152
## Hypodum              0.25342    0.21881   1.158    0.247
## novslow             -0.23180    0.38030  -0.610    0.542
## highVsother         -0.34086    0.34946  -0.975    0.329
## Hypodum:novslow      0.08254    0.51672   0.160    0.873
## Hypodum:highVsother -0.37297    0.48025  -0.777    0.437
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##         (Intercept)             Hypodum             novslow         highVsother 
##           0.7949151           1.2884237           0.7931034           0.7111602 
##     Hypodum:novslow Hypodum:highVsother 
##           1.0860431           0.6886863
# low vs other 
#real dummy
logit.1 <- glm(die ~ (Realdum)*(highvsno + lowVsother), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Realdum) * (highvsno + lowVsother), family = binomial, 
##     data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                    Estimate Std. Error z value Pr(>|z|)  
## (Intercept)        -0.01871    0.15464  -0.121   0.9037  
## Realdum            -0.21081    0.22256  -0.947   0.3435  
## highvsno            0.76704    0.43553   1.761   0.0782 .
## lowVsother          0.53278    0.32439   1.642   0.1005  
## Realdum:highvsno   -0.54208    0.59465  -0.912   0.3620  
## Realdum:lowVsother -0.18850    0.46139  -0.409   0.6829  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##        (Intercept)            Realdum           highvsno         lowVsother 
##          0.9814605          0.8099308          2.1533742          1.7036597 
##   Realdum:highvsno Realdum:lowVsother 
##          0.5815379          0.8282016
#hypo dummy
logit.1 <- glm(die ~ (Hypodum)*(novslow + highVsother), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Hypodum) * (novslow + highVsother), family = binomial, 
##     data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)
## (Intercept)         -0.22952    0.16007  -1.434    0.152
## Hypodum              0.25342    0.21881   1.158    0.247
## novslow             -0.23180    0.38030  -0.610    0.542
## highVsother         -0.34086    0.34946  -0.975    0.329
## Hypodum:novslow      0.08254    0.51672   0.160    0.873
## Hypodum:highVsother -0.37297    0.48025  -0.777    0.437
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##         (Intercept)             Hypodum             novslow         highVsother 
##           0.7949151           1.2884237           0.7931034           0.7111602 
##     Hypodum:novslow Hypodum:highVsother 
##           1.0860431           0.6886863
## no vs other
#real dummy
logit.1 <- glm(die ~ (Realdum)*(noVsother + Highvslow), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Realdum) * (noVsother + Highvslow), family = binomial, 
##     data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                   Estimate Std. Error z value Pr(>|z|)  
## (Intercept)         0.0239     0.1492   0.160   0.8727  
## Realdum            -0.2534     0.2188  -1.158   0.2468  
## noVsother           0.2450     0.3007   0.815   0.4153  
## Highvslow           0.7885     0.3827   2.060   0.0394 *
## Realdum:noVsother  -0.2484     0.4545  -0.547   0.5847  
## Realdum:Highvslow  -0.3317     0.5469  -0.606   0.5442  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##       (Intercept)           Realdum         noVsother         Highvslow 
##         1.0241874         0.7761422         1.2775804         2.2000000 
## Realdum:noVsother Realdum:Highvslow 
##         0.7800554         0.7177033
#hypo dummy
logit.1 <- glm(die ~ (Hypodum)*(noVsother + Highvslow), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Hypodum) * (noVsother + Highvslow), family = binomial, 
##     data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                    Estimate Std. Error z value Pr(>|z|)
## (Intercept)       -0.229520   0.160067  -1.434    0.152
## Hypodum            0.253420   0.218807   1.158    0.247
## noVsother         -0.003422   0.340762  -0.010    0.992
## Highvslow          0.456758   0.390681   1.169    0.242
## Hypodum:noVsother  0.248390   0.454471   0.547    0.585
## Hypodum:Highvslow  0.331699   0.546923   0.606    0.544
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##       (Intercept)           Hypodum         noVsother         Highvslow 
##         0.7949151         1.2884237         0.9965834         1.5789474 
## Hypodum:noVsother Hypodum:Highvslow 
##         1.2819603         1.3933333

Excluding nonpunishers - prob simple effects for cost

## high vs other 
logit.1 <- glm(die ~ (Realdum)*(novslow + highVsother), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Realdum) * (novslow + highVsother), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)  
## (Intercept)           0.3868     0.2075   1.864   0.0623 .
## Realdum              -0.5205     0.3031  -1.718   0.0859 .
## novslow              -0.4235     0.4686  -0.904   0.3661  
## highVsother          -0.8308     0.4719  -1.760   0.0783 .
## Realdum:novslow      -0.3404     0.7079  -0.481   0.6306  
## Realdum:highVsother   0.5661     0.6713   0.843   0.3991  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##         (Intercept)             Realdum             novslow         highVsother 
##           1.4722619           0.5942181           0.6547619           0.4357089 
##     Realdum:novslow Realdum:highVsother 
##           0.7114625           1.7614053
logit.1 <- glm(die ~ (Hypodum)*(novslow + highVsother), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Hypodum) * (novslow + highVsother), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)  
## (Intercept)          -0.1337     0.2209  -0.605   0.5450  
## Hypodum               0.5205     0.3031   1.718   0.0859 .
## novslow              -0.7639     0.5306  -1.440   0.1500  
## highVsother          -0.2647     0.4775  -0.554   0.5794  
## Hypodum:novslow       0.3404     0.7079   0.481   0.6306  
## Hypodum:highVsother  -0.5661     0.6713  -0.843   0.3991  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##         (Intercept)             Hypodum             novslow         highVsother 
##           0.8748447           1.6828837           0.4658385           0.7674599 
##     Hypodum:novslow Hypodum:highVsother 
##           1.4055556           0.5677285
# low vs other 
logit.1 <- glm(die ~ (Realdum)*(highvsno + lowVsother), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Realdum) * (highvsno + lowVsother), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                    Estimate Std. Error z value Pr(>|z|)  
## (Intercept)         0.34553    0.21940   1.575   0.1153  
## Realdum            -0.47924    0.31133  -1.539   0.1237  
## highvsno            0.74285    0.59488   1.249   0.2118  
## lowVsother          0.79491    0.46320   1.716   0.0861 .
## Realdum:highvsno   -0.86014    0.78842  -1.091   0.2753  
## Realdum:lowVsother -0.08964    0.67299  -0.133   0.8940  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##        (Intercept)            Realdum           highvsno         lowVsother 
##          1.4127394          0.6192541          2.1019113          2.2142354 
##   Realdum:highvsno Realdum:lowVsother 
##          0.4231045          0.9142644
logit.1 <- glm(die ~ (Hypodum)*(novslow + highVsother), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Hypodum) * (novslow + highVsother), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)  
## (Intercept)          -0.1337     0.2209  -0.605   0.5450  
## Hypodum               0.5205     0.3031   1.718   0.0859 .
## novslow              -0.7639     0.5306  -1.440   0.1500  
## highVsother          -0.2647     0.4775  -0.554   0.5794  
## Hypodum:novslow       0.3404     0.7079   0.481   0.6306  
## Hypodum:highVsother  -0.5661     0.6713  -0.843   0.3991  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##         (Intercept)             Hypodum             novslow         highVsother 
##           0.8748447           1.6828837           0.4658385           0.7674599 
##     Hypodum:novslow Hypodum:highVsother 
##           1.4055556           0.5677285
## no vs other
logit.1 <- glm(die ~ (Realdum)*(noVsother + Highvslow), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Realdum) * (noVsother + Highvslow), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                   Estimate Std. Error z value Pr(>|z|)  
## (Intercept)        0.38680    0.20748   1.864   0.0623 .
## Realdum           -0.52051    0.30305  -1.718   0.0859 .
## noVsother          0.09778    0.39408   0.248   0.8040  
## Highvslow          1.04252    0.55633   1.874   0.0609 .
## Realdum:noVsother -0.53838    0.58965  -0.913   0.3612  
## Realdum:Highvslow -0.39590    0.79906  -0.495   0.6203  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##       (Intercept)           Realdum         noVsother         Highvslow 
##         1.4722619         0.5942181         1.1027177         2.8363636 
## Realdum:noVsother Realdum:Highvslow 
##         0.5836928         0.6730769
logit.1 <- glm(die ~ (Hypodum)*(noVsother + Highvslow), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (Hypodum) * (noVsother + Highvslow), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                   Estimate Std. Error z value Pr(>|z|)  
## (Intercept)        -0.1337     0.2209  -0.605   0.5450  
## Hypodum             0.5205     0.3031   1.718   0.0859 .
## noVsother          -0.4406     0.4386  -1.004   0.3151  
## Highvslow           0.6466     0.5736   1.127   0.2596  
## Hypodum:noVsother   0.5384     0.5897   0.913   0.3612  
## Hypodum:Highvslow   0.3959     0.7991   0.495   0.6203  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##       (Intercept)           Hypodum         noVsother         Highvslow 
##         0.8748447         1.6828837         0.6436484         1.9090909 
## Hypodum:noVsother Hypodum:Highvslow 
##         1.7132300         1.4857143

prob simple effects for hypo vs real

#hypo vs. no cost simple effect
logit.1 <- glm(die ~ (HypoVsReal)*(nodum + Highvslow), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (nodum + Highvslow), family = binomial, 
##     data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                      Estimate Std. Error z value Pr(>|z|)  
## (Intercept)           -0.0223     0.1815  -0.123   0.9022  
## HypoVsReal             0.4190     0.3630   1.154   0.2484  
## nodum                 -0.1208     0.2272  -0.531   0.5951  
## Highvslow              0.6226     0.2735   2.277   0.0228 *
## HypoVsReal:nodum      -0.2484     0.4545  -0.547   0.5847  
## HypoVsReal:Highvslow   0.3317     0.5469   0.606   0.5442  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##          (Intercept)           HypoVsReal                nodum 
##            0.9779517            1.5204604            0.8862353 
##            Highvslow     HypoVsReal:nodum HypoVsReal:Highvslow 
##            1.8637822            0.7800554            1.3933333
#hypo vs. high cost simple effect
logit.1 <- glm(die ~ (HypoVsReal)*(novslow + highdum), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (novslow + highdum), family = binomial, 
##     data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)  
## (Intercept)        -0.454372   0.202415  -2.245   0.0248 *
## HypoVsReal          0.004773   0.404830   0.012   0.9906  
## novslow            -0.190531   0.258361  -0.737   0.4608  
## highdum             0.527342   0.240124   2.196   0.0281 *
## HypoVsReal:novslow  0.082541   0.516722   0.160   0.8731  
## HypoVsReal:highdum  0.372969   0.480247   0.777   0.4374  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##        (Intercept)         HypoVsReal            novslow            highdum 
##          0.6348467          1.0047847          0.8265200          1.6944231 
## HypoVsReal:novslow HypoVsReal:highdum 
##          1.0860431          1.4520399
#hypo vs. low cost simple effect
logit.1 <- glm(die ~ (HypoVsReal)*(d$highvsno + d$lowdum), data = d, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (d$highvsno + d$lowdum), family = binomial, 
##     data = d)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3232  -1.1774  -0.9906   1.1774   1.3765  
## 
## Coefficients:
##                       Estimate Std. Error z value Pr(>|z|)  
## (Intercept)             0.1682     0.1839   0.915   0.3602  
## HypoVsReal              0.3365     0.3677   0.915   0.3602  
## d$highvsno              0.4960     0.2973   1.668   0.0953 .
## d$lowdum               -0.4385     0.2307  -1.901   0.0573 .
## HypoVsReal:d$highvsno   0.5421     0.5946   0.912   0.3620  
## HypoVsReal:d$lowdum    -0.1885     0.4614  -0.409   0.6829  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 484.79  on 349  degrees of freedom
## Residual deviance: 477.00  on 344  degrees of freedom
## AIC: 489
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##           (Intercept)            HypoVsReal            d$highvsno 
##             1.1832160             1.4000000             1.6421336 
##              d$lowdum HypoVsReal:d$highvsno   HypoVsReal:d$lowdum 
##             0.6449843             1.7195785             0.8282016

Excluding non punishers prob simple effects for hypo vs real

#hypo vs. no cost simple effect
logit.1 <- glm(die ~ (HypoVsReal)*(nodum + Highvslow), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (nodum + Highvslow), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                      Estimate Std. Error z value Pr(>|z|)  
## (Intercept)           0.01227    0.21683   0.057   0.9549  
## HypoVsReal            0.87943    0.43367   2.028   0.0426 *
## nodum                 0.17141    0.29483   0.581   0.5610  
## Highvslow             0.84457    0.39953   2.114   0.0345 *
## HypoVsReal:nodum     -0.53838    0.58965  -0.913   0.3612  
## HypoVsReal:Highvslow  0.39590    0.79906   0.495   0.6203  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##          (Intercept)           HypoVsReal                nodum 
##            1.0123461            2.4095238            1.1869802 
##            Highvslow     HypoVsReal:nodum HypoVsReal:Highvslow 
##            2.3269886            0.5836928            1.4857143
#hypo vs. high cost simple effect
logit.1 <- glm(die ~ (HypoVsReal)*(novslow + highdum), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (novslow + highdum), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                    Estimate Std. Error z value Pr(>|z|)  
## (Intercept)         -0.2386     0.2852  -0.837   0.4028  
## HypoVsReal           0.1431     0.5704   0.251   0.8019  
## novslow             -0.5937     0.3540  -1.677   0.0935 .
## highdum              0.5477     0.3357   1.632   0.1027  
## HypoVsReal:novslow   0.3404     0.7079   0.481   0.6306  
## HypoVsReal:highdum   0.5661     0.6713   0.843   0.3991  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##        (Intercept)         HypoVsReal            novslow            highdum 
##          0.7877264          1.1538462          0.5522801          1.7293144 
## HypoVsReal:novslow HypoVsReal:highdum 
##          1.4055556          1.7614053
#hypo vs. low  cost simple effect
logit.1 <- glm(die ~ (HypoVsReal)*(highvsno + lowdum), data = df1, family=binomial)
summary(logit.1)
## 
## Call:
## glm(formula = die ~ (HypoVsReal) * (highvsno + lowdum), family = binomial, 
##     data = df1)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5645  -1.1073   0.8346   1.0383   1.3635  
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)  
## (Intercept)          0.60597    0.27977   2.166   0.0303 *
## HypoVsReal           0.53900    0.55955   0.963   0.3354  
## highvsno             0.31278    0.39421   0.793   0.4275  
## lowdum              -0.75009    0.33649  -2.229   0.0258 *
## HypoVsReal:highvsno  0.86014    0.78842   1.091   0.2753  
## HypoVsReal:lowdum   -0.08964    0.67299  -0.133   0.8940  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 275.98  on 199  degrees of freedom
## Residual deviance: 265.48  on 194  degrees of freedom
## AIC: 277.48
## 
## Number of Fisher Scoring iterations: 4
exp(coef(logit.1))
##         (Intercept)          HypoVsReal            highvsno              lowdum 
##           1.8330303           1.7142857           1.3672193           0.4723243 
## HypoVsReal:highvsno   HypoVsReal:lowdum 
##           2.3634824           0.9142644

graphs - probability of die odd die roll

group by real or hypo

int.plot <- ggplot(d[!is.na(d$real_con),], aes(x = real_con, y = die, fill = d$cost_con)) +
  ggtitle("die role outcome - odd = punishment happens") +
  geom_bar(stat = "summary", fun = "mean" , position = position_dodge(.9))+
  stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(.9),fun.args = list(mult = 1), width = .2)

int.plot  + theme(
  # Remove panel border
  panel.border = element_blank(),  
  # Remove panel grid lines
  panel.grid.major = element_blank(),
  panel.grid.minor = element_blank(),
  # Remove panel background
  panel.background = element_blank(),
  # Add axis line
  axis.line = element_line(colour = "grey")
  ) + xlab("Condition" ) + ylab("Probability of rolling an odd number")+ scale_fill_manual("Punishment cost", values = c("red","gold2", "lightgreen")) + scale_x_discrete(labels = c("Hypotheical", "Real") ) 
## Warning: Use of `d$cost_con` is discouraged.
## ℹ Use `cost_con` instead.
## Use of `d$cost_con` is discouraged.
## ℹ Use `cost_con` instead.

graphs - probability of punish

group by real or hypo

int.plot <- ggplot(d[!is.na(d$real_con),], aes(x = real_con, y = punplus, fill = d$cost_con)) +
  ggtitle("odds punishment happens") +
  geom_bar(stat = "summary", fun = "mean" , position = position_dodge(.9))+
  stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(.9),fun.args = list(mult = 1), width = .2)

int.plot  + theme(
  # Remove panel border
  panel.border = element_blank(),  
  # Remove panel grid lines
  panel.grid.major = element_blank(),
  panel.grid.minor = element_blank(),
  # Remove panel background
  panel.background = element_blank(),
  # Add axis line
  axis.line = element_line(colour = "grey")
  ) + xlab("Condition" ) + ylab("Probability of punishing")+ scale_fill_manual("Punishment cost", values = c("red","gold2", "lightgreen")) + scale_x_discrete(labels = c("Hypotheical", "Real") ) 
## Warning: Use of `d$cost_con` is discouraged.
## ℹ Use `cost_con` instead.
## Use of `d$cost_con` is discouraged.
## ℹ Use `cost_con` instead.

prob of odd die roll group by real or hypo exclude nonpunishers

int.plot <- ggplot(df1[!is.na(df1$real_con),], aes(x = df1$real_con, y = df1$die, fill = df1$cost_con)) +
  ggtitle("die role outcome - odd = punishment happens") +
  geom_bar(stat = "summary", fun = "mean" , position = position_dodge(.9))+
  stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(.9),fun.args = list(mult = 1), width = .2)

int.plot  + theme(
  # Remove panel border
  panel.border = element_blank(),  
  # Remove panel grid lines
  panel.grid.major = element_blank(),
  panel.grid.minor = element_blank(),
  # Remove panel background
  panel.background = element_blank(),
  # Add axis line
  axis.line = element_line(colour = "grey")
  ) + xlab("Condition" ) + ylab("Probability of rolling an odd number")+ scale_fill_manual("Punishment cost", values = c("red","gold2", "lightgreen")) + scale_x_discrete(labels = c("Hypotheical", "Real") ) 

odd roll prob groups by cost

int.plot <- ggplot(d[!is.na(d$real_con),], aes(x = cost_con, y = die, fill = d$real_con)) +
  ggtitle("die role outcome - odd = punishment happens") +
  geom_bar(stat = "summary", fun = "mean" , position = position_dodge(.9))+
  stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(.9),fun.args = list(mult = 1), width = .2)

int.plot  + theme(
  # Remove panel border
  panel.border = element_blank(),  
  # Remove panel grid lines
  panel.grid.major = element_blank(),
  panel.grid.minor = element_blank(),
  # Remove panel background
  panel.background = element_blank(),
  # Add axis line
  axis.line = element_line(colour = "grey")
  ) + xlab("Condition" ) + ylab("Probability of rolling an odd number")+ scale_fill_manual("Punishment cost", values = c("lightpink", "powderblue")) + scale_x_discrete(labels = c("High", "low","no") ) 
## Warning: Use of `d$real_con` is discouraged.
## ℹ Use `real_con` instead.
## Use of `d$real_con` is discouraged.
## ℹ Use `real_con` instead.

odd roll prob group by cost excluding nonpunishers

int.plot <- ggplot(df1[!is.na(df1$real_con),], aes(x = df1$cost_con, y = df1$die, fill = df1$real_con)) +
  ggtitle("die role outcome - odd = punishment happens") +
  geom_bar(stat = "summary", fun = "mean" , position = position_dodge(.9))+
  stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(.9),fun.args = list(mult = 1), width = .2)

int.plot  + theme(
  # Remove panel border
  panel.border = element_blank(),  
  # Remove panel grid lines
  panel.grid.major = element_blank(),
  panel.grid.minor = element_blank(),
  # Remove panel background
  panel.background = element_blank(),
  # Add axis line
  axis.line = element_line(colour = "grey")
  ) + xlab("Condition" ) + ylab("Probability of rolling an odd number")+ scale_fill_manual("Punishment cost", values = c("lightpink", "powderblue")) + scale_x_discrete(labels = c("High", "low","no") ) 

analysis with no and high only

hypo vs real

df$HypoVsReal<- ((-(1/2))*(df$con == "no hypo")) + ((1/2)*(df$con == "no real")) +((-(1/2))*(df$con == "high hypo")) + ((1/2)*(df$con == "high real"))

df$highvsno<- (((-1/2))*(df$con == "no hypo")) + ((-1/2)*(df$con == "no real")) +((1/2)*(df$con == "high hypo")) + ((1/2)*(df$con == "high real"))

main model

m1 <- lm(df$pun ~ (df$HypoVsReal)*(df$highvsno))
summary(m1)
## 
## Call:
## lm(formula = df$pun ~ (df$HypoVsReal) * (df$highvsno))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.885 -2.388 -1.133  1.867  8.593 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.7033     0.2031  13.309  < 2e-16 ***
## df$HypoVsReal              -0.8658     0.4062  -2.131   0.0341 *  
## df$highvsno                -1.6114     0.4062  -3.967 9.78e-05 ***
## df$HypoVsReal:df$highvsno  -0.2291     0.8124  -0.282   0.7782    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.039 on 226 degrees of freedom
## Multiple R-squared:  0.0801, Adjusted R-squared:  0.06789 
## F-statistic:  6.56 on 3 and 226 DF,  p-value: 0.0002852
m1 <- lm(df$pun ~ (df$HypoVsReal)*(df$highvsno)*df$anger)
summary(m1)
## 
## Call:
## lm(formula = df$pun ~ (df$HypoVsReal) * (df$highvsno) * df$anger)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.973 -2.054 -0.585  1.877  7.715 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                         1.99058    0.51976   3.830 0.000167 ***
## df$HypoVsReal                      -0.98444    1.03952  -0.947 0.344664    
## df$highvsno                        -3.50764    1.03952  -3.374 0.000873 ***
## df$anger                            0.22201    0.14950   1.485 0.138960    
## df$HypoVsReal:df$highvsno          -1.73750    2.07904  -0.836 0.404209    
## df$HypoVsReal:df$anger              0.02197    0.29900   0.073 0.941496    
## df$highvsno:df$anger                0.58987    0.29900   1.973 0.049756 *  
## df$HypoVsReal:df$highvsno:df$anger  0.43804    0.59799   0.733 0.464624    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.026 on 222 degrees of freedom
## Multiple R-squared:  0.1038, Adjusted R-squared:  0.07553 
## F-statistic: 3.673 on 7 and 222 DF,  p-value: 0.0008941

graphs

int.plot <- ggplot(df[!is.na(df$real_con),], aes(x = real_con, y = pun, fill = df$cost_con)) +
  ggtitle("Punishment in dollars") +
  geom_bar(stat = "summary", fun = "mean" , position = position_dodge(.9))+
  stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(.9),fun.args = list(mult = 1), width = .2)

int.plot  + theme(
  # Remove panel border
  panel.border = element_blank(),  
  # Remove panel grid lines
  panel.grid.major = element_blank(),
  panel.grid.minor = element_blank(),
  # Remove panel background
  panel.background = element_blank(),
  # Add axis line
  axis.line = element_line(colour = "grey")
  ) + xlab("Condition" ) + ylab("Dollar Amount punished")+ scale_fill_manual("Punishment cost", values = c("red", "lightgreen")) + scale_x_discrete(labels = c("Hypotheical", "Real") )