This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

library("probemod")
## Warning: package 'probemod' was built under R version 3.1.3
setwd("~/Google Drive/work/Good man effect/analysis/pilot 2 direct questions/data")

load("cleaned_data_final1.csv")

temp$MI_centred = temp$moral_internalization - mean(temp$moral_internalization, na.rm=T)

H1: People higher (vs. lower) in MI Internalization are more grateful when a person is helpful (vs. not helpful). (Based on table 5 and figure 5). Question: What are the main effects/ slopes for help and non-help? Are they significant?

Answer: Yes it is significant. Main Effect of Help on Gratefulness

myModel <- lm('grateful_avg ~ help_binary', data=temp)
summary(myModel)
## 
## Call:
## lm(formula = "grateful_avg ~ help_binary", data = temp)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.9234 -1.2138  0.0766  1.0766  4.7862 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   2.2138     0.1039   21.31   <2e-16 ***
## help_binary   3.7096     0.1519   24.42   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.462 on 370 degrees of freedom
## Multiple R-squared:  0.6172, Adjusted R-squared:  0.6161 
## F-statistic: 596.5 on 1 and 370 DF,  p-value: < 2.2e-16

Question 2: Are the “contrasts” significant for higher MI (I think we’ll need a “floodlight analysis” to test this).

Answer: The contrasts are significant for higher MI. Please see the following analysis and results. Conditional Effect of Help on Gratefulness

myModel <- lm('grateful_avg ~ help_binary*MI_centred', data=temp)

jnresults <- jn(myModel, dv='grateful_avg', iv='help_binary', mod='MI_centred', alpha=.01)
plot(jnresults)

## Values of MI_centred indicated by the shaded region
##                      x          y        se         t    p          llci
## Lower Bound: -4.414834 -1.4971988 0.5782272 -2.589292 0.01 -2.994398e+00
## Upper Bound: -2.399187  0.8696872 0.3358784  2.589292 0.01 -1.110223e-16
##                  ulci
## Lower Bound: 0.000000
## Upper Bound: 1.739374

H2: People higher (vs. lower) in MI Internalization are less upset at a person when they are helpful (vs. not helpful). (Based on table 6 and figure 6). Questions: Same as for H1.

Answer to Q1. Main effect of Help on Upset.

myModel <- lm('upset_avg ~ help_binary', data=temp)
summary(myModel)
## 
## Call:
## lm(formula = "upset_avg ~ help_binary", data = temp)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.3182 -0.8793 -0.3182  1.0415  5.1207 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   4.3182     0.1078   40.06   <2e-16 ***
## help_binary  -2.4389     0.1576  -15.47   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.517 on 370 degrees of freedom
## Multiple R-squared:  0.3928, Adjusted R-squared:  0.3912 
## F-statistic: 239.4 on 1 and 370 DF,  p-value: < 2.2e-16

Answer to Q2. Conditional Effect of Help on Upset

myModel <- lm('upset_avg ~ help_binary*MI_centred', data=temp)

jnresults <- jn(myModel, dv='upset_avg', iv='help_binary', mod='MI_centred', alpha=.01)
plot(jnresults)

## Values of MI_centred indicated by the shaded region
##                      x          y        se         t    p          llci
## Lower Bound: -9.779649  3.6164111 1.3966797  2.589292 0.01 -4.440892e-16
## Upper Bound: -2.346008 -0.9551079 0.3688684 -2.589292 0.01 -1.910216e+00
##                      ulci
## Lower Bound: 7.232822e+00
## Upper Bound: 2.220446e-16

H3: There will be a 3-way interaction between MI Int., helpfulness, and reputation, such that higher MI Int. participants will be less upset at someone with a bad reputation when they help (vs. not help). For people with a good reputation, no such interaction will occur.

Question 1: What is the p-value for the 3-way interaction? Answer: See the following results: p-value: < 0.01

Question 2: Are the “red and/or blue” slopes significant for “bad reputation”? Yes. Please see the “help_binary” row in the results: It says the upset rating decreases 2.129 (and this difference is significant) from the Non-Help to the Help condition for Bad Reputation people (i.e., when “good_binary” is 0) and MI is at its mean.

model1=lm(upset_avg~help_binary*good_binary*MI_centred, data=temp)
summary(model1)
## 
## Call:
## lm(formula = upset_avg ~ help_binary * good_binary * MI_centred, 
##     data = temp)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.6094 -0.7069 -0.2182  0.9506  5.7818 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)
## (Intercept)                          4.4215     0.1437  30.768  < 2e-16
## help_binary                         -2.1292     0.2079 -10.244  < 2e-16
## good_binary                         -0.1736     0.2066  -0.840  0.40139
## MI_centred                           0.2667     0.1240   2.151  0.03212
## help_binary:good_binary             -0.6306     0.3030  -2.082  0.03808
## help_binary:MI_centred              -0.9494     0.1926  -4.929 1.26e-06
## good_binary:MI_centred              -0.2979     0.1842  -1.617  0.10677
## help_binary:good_binary:MI_centred   0.7362     0.2786   2.643  0.00858
##                                       
## (Intercept)                        ***
## help_binary                        ***
## good_binary                           
## MI_centred                         *  
## help_binary:good_binary            *  
## help_binary:MI_centred             ***
## good_binary:MI_centred                
## help_binary:good_binary:MI_centred ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.446 on 364 degrees of freedom
## Multiple R-squared:  0.4569, Adjusted R-squared:  0.4465 
## F-statistic: 43.75 on 7 and 364 DF,  p-value: < 2.2e-16

Question 3: Are the help vs. non-help contrasts significant at high and low levels of MI (I think we’ll need a floodlight analysis for this)?

## only look at the bad reputation 
fit.bad <- subset(temp, temp$good_binary == 0)

myModel <- lm('upset_avg ~ help_binary*MI_centred', data=fit.bad)

jnresults <- jn(myModel, dv='upset_avg', iv='help_binary', mod='MI_centred', alpha=.01)
plot(jnresults)

## Values of MI_centred indicated by the shaded region
##                      x          y        se         t    p      llci
## Lower Bound: -4.723681  2.3556868 0.9054016  2.601814 0.01  0.000000
## Upper Bound: -1.360628 -0.8373472 0.3218320 -2.601814 0.01 -1.674694
##                      ulci
## Lower Bound: 4.711374e+00
## Upper Bound: 2.220446e-16

Question 4: Give all the results to each item in Upset

Item “annoyed” H2 of item “annoyed”

myModel <- lm('annoyed ~ help_binary', data=temp)
summary(myModel)
## 
## Call:
## lm(formula = "annoyed ~ help_binary", data = temp)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.596 -0.931  0.069  1.404  5.069 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   4.5960     0.1214   37.87   <2e-16 ***
## help_binary  -2.6649     0.1774  -15.02   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.708 on 370 degrees of freedom
## Multiple R-squared:  0.3787, Adjusted R-squared:  0.3771 
## F-statistic: 225.6 on 1 and 370 DF,  p-value: < 2.2e-16
myModel <- lm('annoyed ~ help_binary*MI_centred', data=temp)

jnresults <- jn(myModel, dv='annoyed', iv='help_binary', mod='MI_centred', alpha=.01)
plot(jnresults)

## Values of MI_centred indicated by the shaded region
##                       x         y        se         t    p      llci
## Lower Bound: -11.707932  4.893040 1.8897212  2.589292 0.01  0.000000
## Upper Bound:  -2.385321 -1.096646 0.4235313 -2.589292 0.01 -2.193292
##                  ulci
## Lower Bound: 9.786079
## Upper Bound: 0.000000

H3 of item “annoyed”

model1=lm(annoyed~help_binary*good_binary*MI_centred, data=temp)
summary(model1)
## 
## Call:
## lm(formula = annoyed ~ help_binary * good_binary * MI_centred, 
##     data = temp)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.3719 -0.8815 -0.1303  1.0494  5.8697 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)
## (Intercept)                          4.9842     0.1604  31.078  < 2e-16
## help_binary                         -2.5446     0.2320 -10.970  < 2e-16
## good_binary                         -0.7533     0.2306  -3.266  0.00119
## MI_centred                           0.3511     0.1384   2.537  0.01159
## help_binary:good_binary             -0.2549     0.3381  -0.754  0.45143
## help_binary:MI_centred              -0.9681     0.2150  -4.503 9.04e-06
## good_binary:MI_centred              -0.3681     0.2056  -1.790  0.07421
## help_binary:good_binary:MI_centred   0.7125     0.3109   2.292  0.02250
##                                       
## (Intercept)                        ***
## help_binary                        ***
## good_binary                        ** 
## MI_centred                         *  
## help_binary:good_binary               
## help_binary:MI_centred             ***
## good_binary:MI_centred             .  
## help_binary:good_binary:MI_centred *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.614 on 364 degrees of freedom
## Multiple R-squared:  0.4538, Adjusted R-squared:  0.4433 
## F-statistic:  43.2 on 7 and 364 DF,  p-value: < 2.2e-16
## only look at the bad reputation 
fit.bad <- subset(temp, temp$good_binary == 0)

myModel <- lm('annoyed ~ help_binary*MI_centred', data=fit.bad)

jnresults <- jn(myModel, dv='annoyed', iv='help_binary', mod='MI_centred', alpha=.01)
plot(jnresults)

## Values of MI_centred indicated by the shaded region
##                      x         y        se         t    p          llci
## Lower Bound: -6.150264  3.409347 1.3103730  2.601814 0.01 -8.881784e-16
## Upper Bound: -1.565715 -1.028890 0.3954508 -2.601814 0.01 -2.057779e+00
##                  ulci
## Lower Bound: 6.818695
## Upper Bound: 0.000000

Item “upset”

H2 of item “upset”

myModel <- lm('upset ~ help_binary', data=temp)
summary(myModel)
## 
## Call:
## lm(formula = "upset ~ help_binary", data = temp)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.2121 -0.8161 -0.8161  1.1839  5.1839 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   4.2121     0.1215   34.67   <2e-16 ***
## help_binary  -2.3960     0.1776  -13.49   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.709 on 370 degrees of freedom
## Multiple R-squared:  0.3296, Adjusted R-squared:  0.3278 
## F-statistic: 181.9 on 1 and 370 DF,  p-value: < 2.2e-16
myModel <- lm('upset ~ help_binary*MI_centred', data=temp)

jnresults <- jn(myModel, dv='upset', iv='help_binary', mod='MI_centred', alpha=.01)
plot(jnresults)

## Values of MI_centred indicated by the shaded region
##                       x         y        se         t    p      llci
## Lower Bound: -15.156665  6.358058 2.4555200  2.589292 0.01  0.000000
## Upper Bound:  -2.267866 -1.058546 0.4088167 -2.589292 0.01 -2.117091
##                      ulci
## Lower Bound: 1.271612e+01
## Upper Bound: 2.220446e-16

H3 of item “upset”

model1=lm(upset~help_binary*good_binary*MI_centred, data=temp)
summary(model1)
## 
## Call:
## lm(formula = upset ~ help_binary * good_binary * MI_centred, 
##     data = temp)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.4752 -0.9781 -0.2298  1.3152  5.8677 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)
## (Intercept)                         4.18468    0.16493  25.373  < 2e-16
## help_binary                        -1.94150    0.23854  -8.139 6.39e-15
## good_binary                         0.09974    0.23716   0.421 0.674320
## MI_centred                          0.26303    0.14230   1.848 0.065359
## help_binary:good_binary            -0.94139    0.34769  -2.708 0.007099
## help_binary:MI_centred             -0.82419    0.22109  -3.728 0.000224
## good_binary:MI_centred             -0.25763    0.21142  -1.219 0.223791
## help_binary:good_binary:MI_centred  0.57501    0.31973   1.798 0.072937
##                                       
## (Intercept)                        ***
## help_binary                        ***
## good_binary                           
## MI_centred                         .  
## help_binary:good_binary            ** 
## help_binary:MI_centred             ***
## good_binary:MI_centred                
## help_binary:good_binary:MI_centred .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.66 on 364 degrees of freedom
## Multiple R-squared:  0.3781, Adjusted R-squared:  0.3661 
## F-statistic: 31.61 on 7 and 364 DF,  p-value: < 2.2e-16
## only look at the bad reputation 
fit.bad <- subset(temp, temp$good_binary == 0)

myModel <- lm('upset ~ help_binary*MI_centred', data=fit.bad)

jnresults <- jn(myModel, dv='upset', iv='help_binary', mod='MI_centred', alpha=.01)
plot(jnresults)

## Values of MI_centred indicated by the shaded region
##                      x         y        se         t    p     llci
## Lower Bound: -8.616270  5.159958 1.9832153  2.601814 0.01  0.00000
## Upper Bound: -1.203461 -0.949615 0.3649818 -2.601814 0.01 -1.89923
##                  ulci
## Lower Bound: 10.31992
## Upper Bound:  0.00000

Item feeling bad: “bad”

H2 of Item “bad”:

myModel <- lm('bad ~ help_binary', data=temp)
summary(myModel)
## 
## Call:
## lm(formula = "bad ~ help_binary", data = temp)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.1465 -0.8908 -0.1465  0.9175  5.1092 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   4.1465     0.1216   34.09   <2e-16 ***
## help_binary  -2.2557     0.1778  -12.68   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.711 on 370 degrees of freedom
## Multiple R-squared:  0.3031, Adjusted R-squared:  0.3012 
## F-statistic: 160.9 on 1 and 370 DF,  p-value: < 2.2e-16
myModel <- lm('bad ~ help_binary*MI_centred', data=temp)

jnresults <- jn(myModel, dv='bad', iv='help_binary', mod='MI_centred', alpha=.01)
plot(jnresults)

## Values of MI_centred indicated by the shaded region
##                       x          y       se         t    p          llci
## Lower Bound: -10.489026  4.3759220 1.690007  2.589292 0.01 -8.881784e-16
## Upper Bound:  -1.996544 -0.9489572 0.366493 -2.589292 0.01 -1.897914e+00
##                      ulci
## Lower Bound: 8.751844e+00
## Upper Bound: 4.440892e-16

H3 of item “bad”:

model1=lm(bad~help_binary*good_binary*MI_centred, data=temp)
summary(model1)
## 
## Call:
## lm(formula = bad ~ help_binary * good_binary * MI_centred, data = temp)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.5833 -0.8252 -0.2333  0.8707  5.6080 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)
## (Intercept)                          4.0956     0.1635  25.046  < 2e-16
## help_binary                         -1.9014     0.2365  -8.039 1.28e-14
## good_binary                          0.1327     0.2351   0.564  0.57289
## MI_centred                           0.1861     0.1411   1.319  0.18808
## help_binary:good_binary             -0.6956     0.3447  -2.018  0.04435
## help_binary:MI_centred              -1.0561     0.2192  -4.818 2.14e-06
## good_binary:MI_centred              -0.2678     0.2096  -1.278  0.20218
## help_binary:good_binary:MI_centred   0.9212     0.3170   2.906  0.00389
##                                       
## (Intercept)                        ***
## help_binary                        ***
## good_binary                           
## MI_centred                            
## help_binary:good_binary            *  
## help_binary:MI_centred             ***
## good_binary:MI_centred                
## help_binary:good_binary:MI_centred ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.646 on 364 degrees of freedom
## Multiple R-squared:  0.3658, Adjusted R-squared:  0.3536 
## F-statistic:    30 on 7 and 364 DF,  p-value: < 2.2e-16
## only look at the bad reputation 
fit.bad <- subset(temp, temp$good_binary == 0)

myModel <- lm('bad ~ help_binary*MI_centred', data=fit.bad)

jnresults <- jn(myModel, dv='bad', iv='help_binary', mod='MI_centred', alpha=.01)
plot(jnresults)

## Values of MI_centred indicated by the shaded region
##                      x          y        se         t    p          llci
## Lower Bound: -4.129510  2.4595702 0.9453289  2.601814 0.01 -4.440892e-16
## Upper Bound: -1.002883 -0.8423298 0.3237471 -2.601814 0.01 -1.684660e+00
##                      ulci
## Lower Bound: 4.919140e+00
## Upper Bound: 2.220446e-16