-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalysis_confidence.Rmd
224 lines (167 loc) · 9.31 KB
/
analysis_confidence.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
---
title: "Political Conspiracies - choice"
author: "Nick Duran"
date: 05/30/17
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
rm(list=ls())
library(dplyr) ##// generate descriptives
library(lme4) ##// generate mixed effects models
library(multcomp) ##// glht, allows multiple comparisons in unibus models, standardized method for computing p
library(MuMIn) ##// compute effect sizes
library(pander)
source("summary_stats.r")
```
# NONBELIEF SUBSET - BETWEEN PARTISAN
To examine whether the covert mouse tracking measures also reflect a sense of conflict when disavowing party-aligned political conspiraices, we also evaluated participants’ confidence in the correctness of their given reponse to all statement types, as reported on a Likert scale of 1 to 5 (1= low confidence, 5 = high confidence). Specifically, we are interested in whether partisans report lower confidence to their disavowal of party-aligned political conspiracies (relative to other statement types), and/or higher confidence to their disavowal of political conspiracies that originate with the opposing party (relative to other statement types).
To evaluate these confidence scores, and the ways in which they might align with mouse-tracking’ latency and average deviation results, we ran identical mixed-effects models, but now with the Likert-scale confidence score entered as dependent variable. This means that non-belief responses to political and general conspiracy responses within each level of Republican or Democratic responders, testing the interactions between directness of statements and how political conspiracy statements were disavowed relative to a) each other, b) general knowledge statements as baseline, and c) general conspiracy items as baseline.
## Preliminaries
```{r}
#### Read Data ####
fromprep = read.delim("/Users/nduran/Dropbox (ASU)/POLIBELIEFS/analysis/JESP/REDO/3_Ranalysis/Mouse-Traj-2GIT.csv", header = TRUE,sep=',')
```
**Recoding:**
```{r}
fromprep <- within( fromprep, {
group.id <- subjnum ## subject number
item.id <- questionType ## item code
dependent.variable <- value ## action dynamic response variables
## Factor 1: Identification as Republican or Democrat (2-levels; between-subject)
political.identity <- poliID2
## Factor 2: Wording of item direct or indirect (2-levels; within-subject)
statement.direct <- explicit
## Factor 3: Item conspiracy about Bush, Obama, or general, or a general knowledge (4-levels; within-subject)
BO.GB.GK.GC <- resp_type
condition <- ifelse( BO.GB.GK.GC=="Gen Conspiracy", "Gen Conspiracy",
ifelse( BO.GB.GK.GC=="Right-wing", "Obama",
ifelse( BO.GB.GK.GC=="Left-wing", "Bush",
ifelse( BO.GB.GK.GC=="Gen Knowledge", "Gen Knowledge", NA )) ) )
} )
c_scale <- function(x) {
scale(x, scale = FALSE) }
fromprep <- within( fromprep, age.c <- c_scale(fromprep$age) )
```
**Descriptives of main variables:**
```{r echo=FALSE}
fromprep2 = subset( fromprep, endorse!="C" & variable=="choice")
summt = dplyr::summarize(group_by(fromprep2,political.identity,condition),
mean=mean(value), se=sd(value)/sqrt(length(value)))
pander(summt)
```
**Contrast structure:**
```{r}
nonbelief.data <- within( subset( fromprep, endorse!="C" ), {
## for within subjects analysis
republican <- ifelse( poliID2=="Republican", 0,
ifelse( poliID2=="Democrat", 1, NA ) )
## for within subjects analysis
democrat <- ifelse( poliID2=="Democrat", 0,
ifelse( poliID2=="Republican", 1, NA ) )
statement.direct.w <- ifelse( statement.direct=="Reject as False", 1/2,
ifelse( statement.direct=="Accept as True", -1/2, NA ) )
ObamaVsKnowledge <- ifelse( condition=="Bush", 0,
ifelse( condition=="Obama", 1/2,
ifelse( condition=="Gen Conspiracy", 0,
ifelse( condition=="Gen Knowledge", -1/2, NA ))))
BushVsKnowledge <- ifelse( condition=="Bush", 1/2,
ifelse( condition=="Obama", 0,
ifelse( condition=="Gen Conspiracy", 0,
ifelse( condition=="Gen Knowledge", -1/2, NA ))))
GeneralVsKnowledge <- ifelse( condition=="Bush", 0,
ifelse( condition=="Obama", 0,
ifelse( condition=="Gen Conspiracy", 1/2,
ifelse( condition=="Gen Knowledge", -1/2, NA ))))
} )
```
## Statistical Models
**Republicans**
<!-- Important note: "You only pay attention to effects in the following models that do NOT interact with the dummy codes (i.e., ignore any fixed effect that includes "republican" or "democrat," whether it is an interaction or main effect)" -->
```{r message=FALSE}
republican.omnibus.nonbeliever.model <- lmer( dependent.variable ~ (1|group.id) + (1|item.id) + age.c + statement.direct.w * republican * (ObamaVsKnowledge + BushVsKnowledge + GeneralVsKnowledge), data=nonbelief.data, REML=FALSE, na.action = na.exclude, subset=variable=="choice" )
```
```{r echo=FALSE}
df1 = data.frame(summary(republican.omnibus.nonbeliever.model)$coefficients)
df1[1]
```
```{r echo=FALSE}
##// Effect Size
r.squaredGLMM(republican.omnibus.nonbeliever.model)[2]
```
```{r message=FALSE}
##// test for main effect in order to follow-up
republican.nonbeliever.main = update( republican.omnibus.nonbeliever.model, .~.-ObamaVsKnowledge-BushVsKnowledge-GeneralVsKnowledge)
```
```{r echo=FALSE}
modComp(republican.nonbeliever.main,republican.omnibus.nonbeliever.model,"republican.nonbeliever.main")
```
```{r}
planCont = rbind(
# note that "Bush" items become the new baseline
"OvB" = c(0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"OvK" = c(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"BvK" = c(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0),
# note that "General Conspiracy" items become the new baseline
"OvGC" = c(0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0),
"BvGC" = c(0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0))
# note that "General Conspiracy" items become the new baseline
# "OvB:Direct" = c(0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 1, -1),
# "OvK:Direct" = c(0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 1, 0),
# "BvK:Direct" = c(0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 1))
```
```{r echo=FALSE}
runContrasts(republican.omnibus.nonbeliever.model, planCont, "republican/nonbelief")
```
```{r message=FALSE}
##// test for two-way interaction in order to follow-up
republican.nonbeliever.twoway = update( republican.omnibus.nonbeliever.model, .~.-statement.direct.w:ObamaVsKnowledge-statement.direct.w:BushVsKnowledge)
```
```{r echo=FALSE}
modComp(republican.nonbeliever.twoway,republican.omnibus.nonbeliever.model,"republican.nonbeliever.twoway")
```
**Democrats**
<!-- Important note: "You only pay attention to effects in the following models that do NOT interact with the dummy codes (i.e., ignore any fixed effect that includes "republican" or "democrat," whether it is an interaction or main effect)" -->
```{r message=FALSE}
democrat.omnibus.nonbeliever.model <- lmer( dependent.variable ~ (1|group.id) + (1|item.id) + age.c + statement.direct.w * democrat * (ObamaVsKnowledge + BushVsKnowledge + GeneralVsKnowledge), data=nonbelief.data, REML=FALSE, na.action = na.exclude, subset=variable=="choice" )
```
```{r echo=FALSE}
df1 = data.frame(summary(democrat.omnibus.nonbeliever.model)$coefficients)
df1[1]
```
```{r echo=FALSE}
##// Effect Size
r.squaredGLMM(democrat.omnibus.nonbeliever.model)[2]
```
```{r message=FALSE}
##// test for main effect in order to follow-up
democrat.nonbeliever.main = update( democrat.omnibus.nonbeliever.model, .~.-ObamaVsKnowledge-BushVsKnowledge-GeneralVsKnowledge)
```
```{r echo=FALSE}
modComp(democrat.nonbeliever.main,democrat.omnibus.nonbeliever.model,"democrat.nonbeliever.main")
```
```{r}
planCont = rbind(
# note that "Bush" items become the new baseline
"OvB" = c(0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"OvK" = c(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"BvK" = c(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0),
# note that "General Conspiracy" items become the new baseline
"OvGC" = c(0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0),
"BvGC" = c(0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0))
# note that "General Conspiracy" items become the new baseline
# "OvB:Direct" = c(0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 1, -1),
# "OvK:Direct" = c(0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 1, 0),
# "BvK:Direct" = c(0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 1))
```
```{r echo=FALSE}
runContrasts(democrat.omnibus.nonbeliever.model, planCont, "democrat/nonbelief")
```
```{r message=FALSE}
##// test for two-way interaction in order to follow-up
democrat.nonbeliever.twoway = update( democrat.omnibus.nonbeliever.model, .~.-statement.direct.w:ObamaVsKnowledge-statement.direct.w:BushVsKnowledge)
```
```{r echo=FALSE}
modComp(democrat.nonbeliever.twoway,democrat.omnibus.nonbeliever.model,"democrat.nonbeliever.twoway")
```
<!-- Add the planned contrast structure here for the two-way coefficients, assuming overall is significant -->