#contrast code trust conditions
d$trust_.5 <- ifelse(d$condition == "trust", .5, -.5)
d$trustYes_0 <- ifelse(d$condition == "trust", 0, 1)
d$trustNo_0 <- ifelse(d$condition == "trust", 1, 0)
#mean center response time around grand mean
d$respTime_grand_c <- d$respTime - mean(d$respTime)
# mean center response time around condition means
mean(d$respTime[d$condition == 'trust']) #4.20961
## [1] 4.20961
mean(d$respTime[d$condition == 'notTrust']) #4.995662
## [1] 4.995662
d$RTMeans <- ifelse(d$condition == 'trust', 4.20961, 4.995662)
d$respTime_cndt_c <- d$respTime - d$RTMeans
# lots of positive skew for response time
hist(d$respTime)
#log response time
d$logRespTime <- log(d$respTime)
#log response time to make normal distribution
hist(d$logRespTime)
# mean center log response time around grand mean
d$logRespTime_grand_c <- d$logRespTime - mean(d$logRespTime)
# mean center response time around condition means
mean(d$logRespTime[d$condition == 'trust']) #1.185308
## [1] 1.185308
mean(d$logRespTime[d$condition == 'notTrust']) #1.317966
## [1] 1.317966
d$cndtMeans <- ifelse(d$condition == 'trust', 1.185308, 1.317966)
d$logRespTime_cndt_c <- d$logRespTime - d$cndtMeans
#get rid of outliers
boxplot(d$respTime)
#excluding outside 4*sd
mean(d$respTime)*5 #22.8798
## [1] 22.8798
outliers <- d[which(d$respTime > 22.8798),]
o <- outliers$respTime
d2 <- d[-which(d$respTime %in% o),]
boxplot(d2$respTime)
Across all response time transformations (untransformed RT, log(RT), and with outliers excluded - all for both grand mean centered and condition mean centered) overall significance and interpretation of 3-way interaction remain the same.
model <- glmer(cuedFaceTrusted_1 ~ respTime_grand_c*condition + sideCuedRight_.5 + stim_female_.5 + pt_female_.5 + (1 | participant), family=binomial, data=d)
p1 <- plot_model(model, type = "pred", terms = c("condition"), legend.title = "condition")
p1 + labs(title = " ",
x = "phrasing condition",
y = "probability for cued face chosen to trust with $4.00") + theme_sjplot()
On average, participants have a ~49.3% probability of choosing to trust the cued face with $4.00. Meaning, on average they physically click on the cued face when asked “who do you choose not to trust?” more often than not.
On average, however, participants have a ~53% probability of choosing to trust the cued face with $4.00 in the trust condition. So, here again, they physically click on the cued face when asked “who do you choose to trust?” more often than not.
Early on, when a person is asked “who do you choose to trust?”, the probability of them choosing the cued face is more likley. When they are asked, “who do you choose not to trust?” the probability of choosing the cued face is also more likely. However, the probability of choosing the cued face decreases as time goes on.
What this interaction is hinting at, is that later on in the decision-making process they choose at random (or we don’t have predictors to account for their choice). However, when they decide quickly, they are more likley to choose the cued face whether they are being asked “who do you trust?” or “who do you not trust?”
mRT <- glmer(cuedFaceTrusted_1 ~ respTime_grand_c*trust_.5 + sideCuedRight_.5 + stim_female_.5 + pt_female_.5 + (1 | participant), family=binomial, data=d)
summary(mRT)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: cuedFaceTrusted_1 ~ respTime_grand_c * trust_.5 + sideCuedRight_.5 +
## stim_female_.5 + pt_female_.5 + (1 | participant)
## Data: d
##
## AIC BIC logLik deviance df.resid
## 7640.7 7693.7 -3812.4 7624.7 5517
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.3114 -1.0057 0.7943 0.9639 1.5346
##
## Random effects:
## Groups Name Variance Std.Dev.
## participant (Intercept) 0.06864 0.262
## Number of obs: 5525, groups: participant, 221
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 4.522e-02 3.591e-02 1.259 0.2080
## respTime_grand_c -6.154e-03 7.110e-03 -0.866 0.3867
## trust_.5 1.467e-01 6.518e-02 2.251 0.0244 *
## sideCuedRight_.5 -8.756e-04 5.470e-02 -0.016 0.9872
## stim_female_.5 -1.221e-02 5.985e-02 -0.204 0.8383
## pt_female_.5 1.368e-06 6.718e-02 0.000 1.0000
## respTime_grand_c:trust_.5 -3.448e-02 1.421e-02 -2.427 0.0152 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rspT__ trs_.5 sCR_.5 st__.5 pt__.5
## rspTm_grnd_ -0.008
## trust_.5 -0.059 0.084
## sdCdRght_.5 -0.007 0.032 0.000
## stim_fml_.5 -0.344 -0.005 0.006 0.013
## pt_femal_.5 -0.242 0.057 -0.010 0.002 0.003
## rspTm__:_.5 0.080 0.102 0.005 0.008 -0.004 -0.005
p2 <- plot_model(mRT, type = "pred", terms = c("respTime_grand_c", "trust_.5"), legend.title = "condition")
## Data were 'prettified'. Consider using `terms="respTime_grand_c [all]"` to get smooth plots.
p2 + labs(title = "outliers included model",
x = "mean centered response time (M = 4.58 sec)",
y = "probability of cued face chosen to trust $4.00 with") +
scale_color_discrete(labels = c("not trust", "trust")) +
theme_sjplot()
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
mlogRT <- glmer(cuedFaceTrusted_1 ~ logRespTime_grand_c*trust_.5 + sideCuedRight_.5 + stim_female_.5 + pt_female_.5 + (1 | participant), family=binomial, data=d)
summary(mlogRT)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula:
## cuedFaceTrusted_1 ~ logRespTime_grand_c * trust_.5 + sideCuedRight_.5 +
## stim_female_.5 + pt_female_.5 + (1 | participant)
## Data: d
##
## AIC BIC logLik deviance df.resid
## 7638.3 7691.3 -3811.2 7622.3 5517
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.3152 -1.0045 0.7888 0.9607 1.4128
##
## Random effects:
## Groups Name Variance Std.Dev.
## participant (Intercept) 0.06703 0.2589
## Number of obs: 5525, groups: participant, 221
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.0431561 0.0358055 1.205 0.22809
## logRespTime_grand_c -0.0009939 0.0412318 -0.024 0.98077
## trust_.5 0.1517229 0.0649478 2.336 0.01949 *
## sideCuedRight_.5 0.0001883 0.0546959 0.003 0.99725
## stim_female_.5 -0.0129653 0.0598492 -0.217 0.82849
## pt_female_.5 0.0058360 0.0669913 0.087 0.93058
## logRespTime_grand_c:trust_.5 -0.2437516 0.0823117 -2.961 0.00306 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) lgRT__ trs_.5 sCR_.5 st__.5 pt__.5
## lgRspTm_gr_ -0.020
## trust_.5 -0.060 0.082
## sdCdRght_.5 -0.007 0.032 0.000
## stim_fml_.5 -0.345 0.000 0.007 0.013
## pt_femal_.5 -0.244 0.064 -0.009 0.002 0.004
## lgRsT__:_.5 0.080 0.040 -0.004 0.008 0.000 -0.019
p3 <- plot_model(mlogRT, type = "pred", terms = c("logRespTime_grand_c", "trust_.5"), legend.title = "condition")
## Data were 'prettified'. Consider using `terms="logRespTime_grand_c [all]"` to get smooth plots.
p3 + labs(title = "log mean centered model",
x = "grand mean centered log(RT)",
y = "probability of cued face chosen to trust $4.00 with") +
scale_color_discrete(labels = c("not trust", "trust")) +
theme_sjplot()
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.