-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponseTrends.Rmd
336 lines (229 loc) · 17.5 KB
/
responseTrends.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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
---
title: "Response Trends"
author: "Nick Duran"
date: 05/31/17
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
rm(list=ls())
library(dplyr)
library(dtplyr)
library(plyr)
library(reshape2)
```
## Preliminaries
```{r}
#### Read Data ####
d2 = read.delim("/Users/nduran/Dropbox (ASU)/POLIBELIEFS/analysis/JESP/REDO/3_Ranalysis/Mouse-Traj-2GIT.csv", header = TRUE,sep=',')
d2 <- tbl_df(d2)
```
## SUBJECT LEVEL
```{r}
print("How many Republicans?")
totREP = length(unique(filter(d2,poliID2 == "Republican")$subjnum))
totREP
print("How many Democrats?")
totDEM = length(unique(filter(d2,poliID2 == "Democrat")$subjnum))
totDEM
print("How many just Republicans and Democrats TOTAL?")
length(unique(filter(d2,poliID2 == "Republican" | poliID2 == "Democrat")$subjnum))
print("Proportion of Republicans")
length(unique(filter(d2,poliID2 == "Republican")$subjnum))/length(unique(filter(d2,poliID2 == "Republican" | poliID2 == "Democrat")$subjnum))*100
print("Proportion of Democrats")
length(unique(filter(d2,poliID2 == "Democrat")$subjnum))/length(unique(filter(d2,poliID2 == "Republican" | poliID2 == "Democrat")$subjnum))*100
```
### Nonbelief
#### Republicans
```{r}
print("How many Republicans REJECTED ALL political conspiracies?")
repNPC = totREP - length(unique(filter(d2,condition=="CRIT" & (topic == "GB" | topic == "BO") & (endorse == "C") & poliID2 == "Republican")$subjnum))
repNPC
repNPC/totREP*100
print("How many Republicans REJECTED ALL general conspiracy theories?")
repNGC = totREP - length(unique(filter(d2,condition=="CRIT" & topic == "GC" & (endorse == "C") & poliID2 == "Republican")$subjnum))
repNGC
repNGC/totREP*100
print("How many Republicans REJECTED AT LEAST ONE political conspiracy CONCORDANT (OBAMA) with their own party?")
length(unique(filter(d2,condition=="CRIT" & topic == "BO" & (endorse == "NC") & poliID2 == "Republican")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "BO" & (endorse == "NC") & poliID2 == "Republican")$subjnum))/totREP*100
print("How many Republicans REJECTED AT LEAST ONE political conspiracy DISCONCORDANT (BUSH) with their own party?")
length(unique(filter(d2,condition=="CRIT" & topic == "GB" & (endorse == "NC") & poliID2 == "Republican")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "GB" & (endorse == "NC") & poliID2 == "Republican")$subjnum))/totREP*100
print("How many Republicans REJECTED AT LEAST ONE general conspiracy theory?")
length(unique(filter(d2,condition=="CRIT" & topic == "GC" & (endorse == "NC") & poliID2 == "Republican")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "GC" & (endorse == "NC") & poliID2 == "Republican")$subjnum))/totREP*100
```
#### Democrats
```{r}
print("How many Democrats REJECTED ALL political conspiracies?")
demNPC = totDEM -length(unique(filter(d2,condition=="CRIT" & (topic == "GB" | topic == "BO") & (endorse == "C") & poliID2 == "Democrat")$subjnum))
demNPC
demNPC/totDEM*100
print("How many Democrats REJECTED ALL general conspiracy theories?")
demNGC = totDEM - length(unique(filter(d2,condition=="CRIT" & topic == "GC" & (endorse == "C") & poliID2 == "Democrat")$subjnum))
demNGC
demNGC/totDEM*100
print("How many Democrats REJECTED AT LEAST ONE political conspiracy CONCORDANT (BUSH) with their own party?")
length(unique(filter(d2,condition=="CRIT" & topic == "GB" & (endorse == "NC") & poliID2 == "Democrat")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "GB" & (endorse == "NC") & poliID2 == "Democrat")$subjnum))/totDEM*100
print("How many Democrats REJECTED AT LEAST ONE political conspiracy DISCONCORDANT (OBAMA) with their own party?")
length(unique(filter(d2,condition=="CRIT" & topic == "BO" & (endorse == "NC") & poliID2 == "Democrat")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "BO" & (endorse == "NC") & poliID2 == "Democrat")$subjnum))/totDEM*100
print("How many Democrats REJECTED AT LEAST ONE general conspiracy theory?")
length(unique(filter(d2,condition=="CRIT" & topic == "GC" & (endorse == "NC") & poliID2 == "Democrat")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "GC" & (endorse == "NC") & poliID2 == "Democrat")$subjnum))/totDEM*100
```
### Belief
#### Republicans
```{r}
print("How many Republicans ACCEPTED AT LEAST ONE political conspiracy CONCORDANT (OBAMA) with their own party?")
length(unique(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Republican")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Republican")$subjnum))/totREP*100
print("How many Republicans ACCEPTED AT LEAST ONE political conspiracy DISCONCORDANT (BUSH) with their own party?")
length(unique(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Republican")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Republican")$subjnum))/totREP*100
print("how many Republicans confirmed at least one general conspiracy?")
length(unique(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "C" & poliID2 == "Republican")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "C" & poliID2 == "Republican")$subjnum))/totREP*100
```
#### Democrats
```{r}
print("How many Democrats ACCEPTED AT LEAST ONE political conspiracy CONCORDANT (BUSH) with their own party?")
length(unique(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Democrat")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Democrat")$subjnum))/totDEM*100
print("How many Democrats ACCEPTED AT LEAST ONE political conspiracy DISCONCORDANT (OBAMA) with their own party?")
length(unique(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Democrat")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Democrat")$subjnum))/totDEM*100
print("how many Democrats confirmed at least one general conspiracy?")
length(unique(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "C" & poliID2 == "Democrat")$subjnum))
length(unique(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "C" & poliID2 == "Democrat")$subjnum))/totDEM*100
```
## ITEM LEVEL
### Nonbelief
#### Republicans
```{r}
print("how many party-concordant political conspiracy theory items (OBAMA) were there for Republicans?")
ConcREP = nrow(filter(d2,condition=="CRIT" & topic == "BO" & poliID2 == "Republican"))
ConcREP
print("how many party-discordant political conspiracy theory items (BUSH) were there for Republicans?")
DisREP = nrow(filter(d2,condition=="CRIT" & topic == "GB" & poliID2 == "Republican"))
DisREP
print("how many general conspiracy items were there for Republicans?")
GCREP = nrow(filter(d2,condition=="CRIT" & topic == "GC" & poliID2 == "Republican"))
GCREP
print("*********")
print("how many of all critical items involving party concordant (OBAMA) were REJECTED, AS DIRECT (FALSE) BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Republican" & explicit == "Reject as False"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Republican" & explicit == "Reject as False"))/ConcREP*100
print("how many of all critical items involving party concordant (OBAMA) were REJECTED, AS INDIRECT (TRUE) BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Republican" & explicit == "Accept as True"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Republican" & explicit == "Accept as True"))/ConcREP*100
print("how many of all critical items involving party concordant (OBAMA) were REJECTED, either DIRECT OR INDIRECT BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Republican"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Republican"))/ConcREP*100
print("*********")
print("how many of all critical items involving party discordant (BUSH) were REJECTED, AS DIRECT (FALSE) BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Republican" & explicit == "Reject as False"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Republican" & explicit == "Reject as False"))/DisREP*100
print("how many of all critical items involving party discordant (BUSH) were REJECTED, AS INDIRECT (TRUE) BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Republican" & explicit == "Accept as True"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Republican" & explicit == "Accept as True"))/DisREP*100
print("how many of all critical items involving party discordant (BUSH) were REJECTED, either DIRECT OR INDIRECT BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Republican"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Republican"))/DisREP*100
print("*********")
print("how many of these general conspiracy items were REJECTED by Republicans?")
nrow(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "NC" & poliID2 == "Republican"))
nrow(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "NC" & poliID2 == "Republican"))/GCREP*100
```
#### Democrats
```{r}
print("how many party-concordant political conspiracy theory items (BUSH) were there for Democrats?")
ConcDEM = nrow(filter(d2,condition=="CRIT" & topic == "GB" & (endorse == "NC" | endorse == "C") & poliID2 == "Democrat"))
ConcDEM
print("how many party-discordant political conspiracy theory items (OBAMA) were there for Democrats?")
DisDEM = nrow(filter(d2,condition=="CRIT" & topic == "BO" & (endorse == "NC" | endorse == "C") & poliID2 == "Democrat"))
DisDEM
print("how many general conspiracy items were there for Democrats?")
GCDEM = nrow(filter(d2,condition=="CRIT" & topic == "GC" & poliID2 == "Democrat"))
GCDEM
print("*********")
print("how many of all critical items involving party concordant (BUSH) were REJECTED, AS DIRECT (FALSE) BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Democrat" & explicit == "Reject as False"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Democrat" & explicit == "Reject as False"))/ConcDEM*100
print("how many of all critical items involving party concordant (BUSH) were REJECTED, AS INDIRECT (TRUE) BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Democrat" & explicit == "Accept as True"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Democrat" & explicit == "Accept as True"))/ConcDEM*100
print("how many of all critical items involving party concordant (BUSH) were REJECTED, either DIRECT OR INDIRECT BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Democrat"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "NC" & poliID2 == "Democrat"))/ConcDEM*100
print("*********")
print("how many of all critical items involving party discordant (OBAMA) were REJECTED, AS DIRECT (FALSE) BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Democrat" & explicit == "Reject as False"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Democrat" & explicit == "Reject as False"))/DisDEM*100
print("how many of all critical items involving party discordant (OBAMA) were REJECTED, AS INDIRECT (TRUE) BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Democrat" & explicit == "Accept as True"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Democrat" & explicit == "Accept as True"))/DisDEM*100
print("how many of all critical items involving party discordant (OBAMA) were REJECTED, either DIRECT OR INDIRECT BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Democrat"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "NC" & poliID2 == "Democrat"))/DisDEM*100
print("*********")
print("how many of these general conspiracy items were REJECTED by Democrats?")
nrow(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "NC" & poliID2 == "Democrat"))
nrow(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "NC" & poliID2 == "Democrat"))/GCDEM*100
```
### Belief
Note the complication here that for the belief.data subset, the Direct statments are now the "accept as true" and Indirect are "reject as false"
#### Republicans
```{r}
print("how many of all critical items involving party concordant (OBAMA) were ACCEPTED, AS DIRECT (TRUE) BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Republican" & explicit == "Accept as True"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Republican" & explicit == "Accept as True"))/ConcREP*100
print("how many of all critical items involving party concordant (OBAMA) were ACCEPTED, AS INDIRECT (FALSE) BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Republican" & explicit == "Reject as False"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Republican" & explicit == "Reject as False"))/ConcREP*100
print("how many of all critical items involving party concordant (OBAMA) were ACCEPTED, either DIRECT OR INDIRECT BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Republican"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Republican"))/ConcREP*100
print("*********")
print("how many of all critical items involving party discordant (BUSH) were ACCEPTED, AS DIRECT (TRUE) BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Republican" & explicit == "Accept as True"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Republican" & explicit == "Accept as True"))/DisREP*100
print("how many of all critical items involving party discordant (BUSH) were ACCEPTED, AS INDIRECT (FALSE) BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Republican" & explicit == "Reject as False"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Republican" & explicit == "Reject as False"))/DisREP*100
print("how many of all critical items involving party discordant (BUSH) were ACCEPTED, either DIRECT OR INDIRECT BY REPUBLICANS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Republican"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Republican"))/DisREP*100
print("*********")
print("how many of these general conspiracy items were ACCEPTED by Republicans?")
nrow(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "C" & poliID2 == "Republican"))
nrow(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "C" & poliID2 == "Republican"))/GCREP*100
```
#### Democrats
```{r}
print("how many of all critical items involving party concordant (BUSH) were ACCEPTED, AS DIRECT (TRUE) BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Democrat" & explicit == "Accept as True"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Democrat" & explicit == "Accept as True"))/ConcDEM*100
print("how many of all critical items involving party concordant (BUSH) were ACCEPTED, AS INDIRECT (FALSE) BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Democrat" & explicit == "Reject as False"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Democrat" & explicit == "Reject as False"))/ConcDEM*100
print("how many of all critical items involving party concordant (BUSH) were ACCEPTED, either DIRECT OR INDIRECT BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Democrat"))
nrow(filter(d2,condition=="CRIT" & topic == "GB" & endorse == "C" & poliID2 == "Democrat"))/ConcDEM*100
print("*********")
print("how many of all critical items involving party discordant (OBAMA) were ACCEPTED, AS DIRECT (TRUE) BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Democrat" & explicit == "Accept as True"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Democrat" & explicit == "Accept as True"))/DisDEM*100
print("how many of all critical items involving party discordant (OBAMA) were ACCEPTED, AS INDIRECT (FALSE) BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Democrat" & explicit == "Reject as False"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Democrat" & explicit == "Reject as False"))/DisDEM*100
print("how many of all critical items involving party discordant (OBAMA) were ACCEPTED, either DIRECT OR INDIRECT BY DEMOCRATS?")
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Democrat"))
nrow(filter(d2,condition=="CRIT" & topic == "BO" & endorse == "C" & poliID2 == "Democrat"))/DisDEM*100
print("*********")
print("how many of these general conspiracy items were ACCEPTED by Democrats?")
nrow(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "C" & poliID2 == "Democrat"))
nrow(filter(d2,condition=="CRIT" & topic == "GC" & endorse == "C" & poliID2 == "Democrat"))/GCDEM*100
```