pilot1= read_csv('/Users/camilla/Documents/Winter 17/Psych254/Porter-etal2016/experiment/pilot1data.csv')
## Parsed with column specification:
## cols(
##   .default = col_character()
## )
## See spec(...) for full column specifications.

From the paper (re: LIB manipulation checks):

“As expected, participants in the favorable-LIB condition believed that Peter was more likely to be helpful in the future (M = 70.29%, SD = 23.58) than did participants in the unfavorable-LIB condition (M = 57.83%, SD = 24.08), t(86) = 2.45, p = .016, d = 0.53. Similarly, participants in the favorable-LIB condition indicated that Peter was less likely to be rude in the future (M = 33.67%, SD = 25.48) compared with participants in the unfavorable-LIB condition (M = 53.93%, SD = 25.22), t(86) = 3.73, p < .001, d = 0.80.”

#condition variable
pilot1 = pilot1 %>%
  slice(3:7) %>%
  mutate(condition= ifelse(is.na(LIB_DV) , "ULIB", "LIB"))
pilot1$condition
## [1] "ULIB" "LIB"  "ULIB" "LIB"  "LIB"
#mean perception of peter as helpful & rude
pilot1$MCfuture_helpful_1=as.numeric(pilot1$MCfuture_helpful_1)
pilot1$MCfuture_rude_1=as.numeric(pilot1$MCfuture_rude_1)

pilot1 %>%
  summarise(meanhelp=mean(MCfuture_helpful_1)) 
## # A tibble: 1 × 1
##   meanhelp
##      <dbl>
## 1     49.8
pilot1 %>%
  summarise(meanrude=mean(MCfuture_rude_1))
## # A tibble: 1 × 1
##   meanrude
##      <dbl>
## 1     47.4
#MC question: are people perceiving peter to be more rude/helpful based on condition?
summary(lm(MCfuture_rude_1 ~ condition, data=pilot1))
## 
## Call:
## lm(formula = MCfuture_rude_1 ~ condition, data = pilot1)
## 
## Residuals:
##       1       2       3       4       5 
##   5.000  -6.333  -5.000 -11.333  17.667 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     22.333      7.679   2.908   0.0621 .
## conditionULIB   62.667     12.141   5.162   0.0141 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.3 on 3 degrees of freedom
## Multiple R-squared:  0.8988, Adjusted R-squared:  0.8651 
## F-statistic: 26.64 on 1 and 3 DF,  p-value: 0.0141
summary(lm(MCfuture_helpful_1 ~ condition, data=pilot1))
## 
## Call:
## lm(formula = MCfuture_helpful_1 ~ condition, data = pilot1)
## 
## Residuals:
##       1       2       3       4       5 
##  17.500  -8.333 -17.500  11.667  -3.333 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)   
## (Intercept)     67.333      9.598   7.015  0.00595 **
## conditionULIB  -43.833     15.176  -2.888  0.06310 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.62 on 3 degrees of freedom
## Multiple R-squared:  0.7355, Adjusted R-squared:  0.6473 
## F-statistic: 8.342 on 1 and 3 DF,  p-value: 0.0631

“Social category inference. The primary dependent measure was participants’ inferences regarding the communicator’s political affiliation. As predicted, participants in the favorable-LIB condition were significantly more likely to believe that the communicator was a Democrat, and thus shared a party affiliation with the target, than were participants in the unfavorable-LIB condition, t(86) = 2.89, p = .005, d = 0.62 (Fig. 1). This difference was not moderated by participants’ self-reported political- party affiliation or ideological endorsement (ps > .18). Our findings suggested initial support for our hypothesis that individuals can infer a communicator’s social identity from his or her language, regardless of their own social identity”

pilot1[is.na(pilot1)] = ''
#creating new 'social identity perception' variable
pilot1=pilot1%>%
  mutate(peterID=paste(LIB_DV, ULIB_DV))

#does LIB condition impact people's perceptions of Peter's identity? (1=definitely a democrat, 7=definitely a republican)
summary(lm(peterID ~ condition, data=pilot1))
## 
## Call:
## lm(formula = peterID ~ condition, data = pilot1)
## 
## Residuals:
##          1          2          3          4          5 
## -5.000e-01  0.000e+00  5.000e-01  2.776e-17  2.776e-17 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)   
## (Intercept)     2.0000     0.2357   8.485  0.00344 **
## conditionULIB   0.5000     0.3727   1.342  0.27223   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4082 on 3 degrees of freedom
## Multiple R-squared:  0.375,  Adjusted R-squared:  0.1667 
## F-statistic:   1.8 on 1 and 3 DF,  p-value: 0.2722