read in data
setwd("~/Google Drive/Research/Bernd")
c<-read.csv ("heal conscious x HL v2.csv", header=T, sep=",")
creating DVs and IVs, excluding people who failed attention check
c$uncanny<-(c$uncanny_4 + c$uncanny_5 + c$uncanny_6)/3
c$comfort<-(11-c$uncanny) #reverse coding
c$useful<-(c$competent_1+c$useful_1)/2
#mind condition
c$mind[c$yes==1]<-1
c$mind[c$no==1]<-0
#body condition
c$body[c$loHL==1]<-0
c$body[c$hiHL==1]<-1
c$mind<-as.factor(c$mind)
c$body<-as.factor(c$body)
c<-subset(c, exclude==0)
2x2 ANOVA, usefulness DV
library(car)
## Loading required package: carData
mod <- lm(useful ~ body*mind, data=c, contrasts=list(body=contr.sum, mind=contr.sum))
Anova(mod, type="III")
## Anova Table (Type III tests)
##
## Response: useful
## Sum Sq Df F value Pr(>F)
## (Intercept) 8785.3 1 1914.4434 < 2.2e-16 ***
## body 2.7 1 0.5878 0.4439004
## mind 52.2 1 11.3680 0.0008483 ***
## body:mind 1.6 1 0.3571 0.5505633
## Residuals 1335.4 291
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
main effect of mind on usefulness
mod <- lm(useful ~ mind, data=c, contrasts=list(mind=contr.sum))
library(emmeans)
em <- emmeans(mod, "mind")
em
## mind emmean SE df lower.CL upper.CL
## 0 5.08 0.180 293 4.72 5.43
## 1 5.91 0.172 293 5.57 6.24
##
## Confidence level used: 0.95
pairs(em)
## contrast estimate SE df t.ratio p.value
## 0 - 1 -0.828 0.249 293 -3.322 0.0010
2x2 ANOVA, comfort DV
mod <- lm(comfort ~ body*mind, data=c, contrasts=list(body=contr.sum, mind=contr.sum))
Anova(mod, type="III")
## Anova Table (Type III tests)
##
## Response: comfort
## Sum Sq Df F value Pr(>F)
## (Intercept) 10578.1 1 1556.6675 < 2.2e-16 ***
## body 253.9 1 37.3611 3.183e-09 ***
## mind 11.4 1 1.6786 0.196154
## body:mind 73.4 1 10.7963 0.001143 **
## Residuals 1957.1 288
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
means, then planned contrasts for comfort DV. first broken down by body, then by mind
em <- emmeans(mod, "mind", "body")
em
## body = 0:
## mind emmean SE df lower.CL upper.CL
## 0 7.69 0.295 288 7.11 8.27
## 1 6.28 0.291 288 5.71 6.86
##
## body = 1:
## mind emmean SE df lower.CL upper.CL
## 0 4.81 0.331 288 4.15 5.46
## 1 5.42 0.307 288 4.81 6.02
##
## Confidence level used: 0.95
pairs(em, by="body")
## body = 0:
## contrast estimate SE df t.ratio p.value
## 0 - 1 1.40 0.415 288 3.386 0.0008
##
## body = 1:
## contrast estimate SE df t.ratio p.value
## 0 - 1 -0.61 0.452 288 -1.351 0.1777
pairs(em, by="mind")
## mind = 0:
## contrast estimate SE df t.ratio p.value
## 0 - 1 2.882 0.444 288 6.497 <.0001
##
## mind = 1:
## contrast estimate SE df t.ratio p.value
## 0 - 1 0.867 0.423 288 2.047 0.0416