-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.R
1506 lines (1452 loc) · 48.3 KB
/
app.R
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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Load Packages ----
library(shiny)
library(shinydashboard)
library(shinyBS)
library(shinyWidgets)
library(boastUtils)
library(dplyr)
library(DT)
# Load additional dependencies and setup functions ----
bank <- read.csv("questionBank.csv", stringsAsFactors = FALSE, header = TRUE)
choicesA <- c("Select Answer", "filtering", "deliberate bias", "anchoring")
choicesB <- c("Select Answer", "unnecessary complexity", "unbiased", "unintentional bias")
choicesC <- c("Select Answer", "filtering", "unnecessary complexity", "unbiased", "unintentional bias")
# Set up UI ----
ui <- list(
dashboardPage(
skin = "red",
## Header ----
dashboardHeader(
title = "Survey Question Bias",
titleWidth = 250,
tags$li(class = "dropdown", actionLink("info", icon("info"))),
tags$li(
class = "dropdown",
boastUtils::surveyLink(name = "Survey_Bias")
),
tags$li(
class = "dropdown",
tags$a(
href = "https://shinyapps.science.psu.edu/",
icon("home")
)
)
),
## Sidebar ----
dashboardSidebar(
sidebarMenu(
id = "pages",
width = 250,
menuItem("Overview", tabName = "overview", icon = icon("gauge-high")),
menuItem("Examples", tabName = "examples", icon = icon("book-open-reader")),
menuItem("Game", tabName = "game", icon = icon("gamepad")),
menuItem("References", tabName = "References", icon = icon("leanpub"))
),
tags$div(
class = "sidebar-logo",
boastUtils::sidebarFooter()
)
),
## Body ----
dashboardBody(
tabItems(
### Overview ----
tabItem(
tabName = "overview",
withMathJax(),
h1("Survey Question Wording Bias"),
p("The goal of this app is to illustrate the different types of biases
that occur in the wording of survey questions."),
h2("Instructions"),
p("On the first page, simply click below each question that contains a
bias to see what that bias is."),
tags$ul(
tags$li("On the first page, simply click below each question that
contains a bias to see what that bias is."),
tags$li("Pay attention! Because on the second page, you will be
asked to match questions with their appropriate bias.")
),
div(
style = "text-align: center;",
bsButton(
inputId = "go1",
label = "GO!",
size = "large",
icon = icon("bolt"),
style = "default"
)
),
br(),
br(),
h2("Acknowledgements"),
p("This app was initially designed and programmed by Ryan Manigly-Haney
with the coding updated by Yuxin Zhang (2017), and Chenese Gray with
input from Xigang Zhang (2020).",
br(),
br(),
"Cite this app as:",
br(),
boastUtils::citeApp(),
br(),
br(),
div(class = "updated", "Last Update: 8/17/2023 by NJH.")
)
),
### Examples Page ----
tabItem(
tabName = "examples",
withMathJax(),
h2("Types of Survey Wording Bias"),
br(),
tabsetPanel(
type = "tabs",
#### Bias Examples tab ----
tabPanel(
title = "Wording Bias",
br(),
h3("Survey Question Wording Bias is a BIG Deal"),
p("Surveys help us understand public opinion on many topics. While
surveys may seem easy to create, there are some common pitfalls
in question wording to watch out for. Expand the boxes below to
see an example of each."),
##### Row 1 ----
fluidRow(
column(
width = 6,
box(
title = "Deliberate Bias",
collapsible = TRUE,
collapsed = TRUE,
width = 12,
p("People who use a form of deliberate bias (also referred to
as One-sided Wording) often desire to gather support for a
specific cause or opinion. Consider the bias example below
then reveal the correct wording."),
br(),
p("Problematic Example:", br(),
"It is hard for today's college graduates to have a bright
future with the way things are today in the world.
Agree or Disagree?"
),
br(),
br(),
bsButton(
inputId = "fixDeliberateBias",
label = "Remove the bias!",
style = "default",
size = "large"
),
br(),
br(),
p(
class = "answertext",
tags$strong(textOutput("deliberateExample", inline = TRUE))
)
)
),
column(
width = 6,
box(
title = "Filtering",
collapsible = TRUE,
collapsed = TRUE,
width = 12,
p("Filtering (or Missing Options) exists when certain choices
such as 'undecided' or 'don't know' are not included in the
list of possible answers. Consider the bias example below
then reveal the correct wording."),
br(),
p("Problematic Example:", br(),
"What is your opinion of our current President?",
tags$ol(
type = "a",
tags$li("Favorable"),
tags$li("Unfavorable")
)
),
br(),
br(),
bsButton(
inputId = "fixFiltering",
label = "Remove the bias!",
style = "default",
size = "large"
),
br(),
br(),
p(
class = "answertext",
tags$strong(uiOutput("filteringExample", inline = TRUE))
)
)
)
),
##### Row 2 ----
fluidRow(
column(
width = 6,
box(
title = "Anchoring",
collapsible = TRUE,
collapsed = TRUE,
width = 12,
p("Anchoring is when questions include a reference point or
anchor. People tend to say close to the anchor because of
either having limited knowledge about the topic or being
distracted by the anchor. Consider the bias example below
then reveal the correct wording."),
br(),
p("Problematic Example:", br(),
"Knowing that the population of the U.S. is 316 million,
what is the population of Canada?"
),
br(),
br(),
bsButton(
inputId = "fixAnchoring",
label = "Remove the bias!",
style = "default",
size = "large"
),
br(),
br(),
p(
class = "answertext",
tags$strong(textOutput("anchoringExample", inline = TRUE))
)
)
),
column(
width = 6,
box(
title = "Unintentional Bias",
collapsible = TRUE,
collapsed = TRUE,
width = 12,
p("Unintentional bias or 'The Use of Loaded Words' is when a
question contains words such as 'forbid', 'control', 'ban',
'outlaw', and 'restraint'. People do not like to be told
that they can't do something so they tend to answer 'oppose'
or 'no', regardless of what question is actually being asked.
Consider the bias example below then reveal the correct
wording."),
br(),
p("Problematic Example:", br(),
"Do you favor or oppose an ordinance that ",
tags$em("forbids"), " surveillance cameras to be placed on
Beaver Ave?",
),
br(),
br(),
bsButton(
inputId = "fixUnintentional",
label = "Remove the bias!",
style = "default",
size = "large"
),
br(),
br(),
p(
class = "answertext",
tags$strong(textOutput("unintentionalExample", inline = TRUE))
)
)
)
),
##### Row 3 ----
fluidRow(
column(
width = 6,
box(
title = "Unnecessarily Complex: Double-barreled",
collapsible = TRUE,
collapsed = TRUE,
width = 12,
p("One way a question can be unnecessarily complex is if it
is composed of two or more separate issues or topics. We
call this type of complex question a ",
tags$em("Double-barrled Question"), ". Consider the bias
example below then reveal the improved wording."),
br(),
p("Problematic Example:", br(),
"Do you think that health care workers and military personnel
should be the first to receive the COVID-19 vaccination?"
),
br(),
br(),
bsButton(
inputId = "fixDoubleBarrel",
label = "Remove the bias!",
style = "default",
size = "large"
),
br(),
br(),
p(
class = "answertext",
tags$strong(uiOutput("doubleBarrelExample", inline = TRUE))
)
)
),
column(
width = 6,
box(
title = "Unnecessarily Complex: Double Negatives",
collapsible = TRUE,
collapsed = TRUE,
width = 12,
p("Another way in which questions can be unnecessarily complex
is through the use of double negatives. Double negative bias
occurs when two negative words are used in one sentence.
Many respondents will not understand what the question is
really asking. Consider the bias example below then reveal
the correct wording."),
br(),
p("Problematic Example:", br(),
"Do you disagree that obese children should not be allowed
to spend a lot of time watching television, playing computer
games, or listening to music?",
),
br(),
br(),
bsButton(
inputId = "fixDoubleNeg",
label = "Remove the bias!",
style = "default",
size = "large"
),
br(),
br(),
p(
class = "answertext",
tags$strong(textOutput("doubleNegExample", inline = TRUE))
)
)
)
)
),
#### Did you know tab ----
tabPanel(
title = "Did you know...",
br(),
p("For the 1948 election between Thomas Dewey and Harry Truman,
Gallup conducted a poll with a sample size of about 3250. Each
individual in the sample was interviewed in person by a
professional interviewer to minimize nonresponse bias, and each
interviewer was given a very detailed set of quotas to meet
(rather than being given a random sample of specific people to
contact)."
),
p("For example, an interviewer could have been given the following
quotas: seven white males under 40 living in a rural area, five
black males under 40 living in an rurban area, six black females
under 40 living in a rural area, etc. Other than meeting these
quotas the ultimate choice of who was interviewed was left to
each interviewer."
),
p("Based on the results of this poll, Gallup predicted a victory
for Dewey, the Republican candidate. The predicted breakdown of
the vote was 50% for Dewey, 44% for Truman, and 6% for third-party
candidates Strom Thurmond and Henry Wallace. The actual results
of the election turned out to be almost exactly reversed: 50% for
Truman, 45% for Dewey, and 5% for third-party candidates."
),
tags$figure(
class = "centerFigure",
tags$img(
src = 'truman.jpg',
height = '50%',
width = '50%',
alt = "Truman holds paper with headline he lost when he won"
),
tags$figcaption("Truman holding paper falsely declaring his
defeat; photo by B. Rollins.")
),
br(),
p("Truman's victory was a great surprise to the nation as a whole.
So convinced was the Chicago Tribune of Dewey's victory that it
went to press on its early edition for November 4, 1948 with the
headline", strong("Dewey defeats Truman.")
),
p("The Gallup Poll learned the lesson that the biases of quota
based polling can be alleviated by using random sampling
techniques. Check out ",
tags$a(href = "http://www.gallup.com", class = "bodylinks",
"the Gallup Website"), " to learn more."
)
)
)
),
### Game Page ----
tabItem(
tabName = "game",
withMathJax(),
h2("Survey Bias Game"),
tabsetPanel(
id = "gameLevels",
type = "hidden",
#### Directions Tab ----
tabPanel(
title = "Directions",
br(),
h3("Directions"),
p("There are three levels to this game. In each level, you'll need
to review proposed survey questions for wording biases (if any).
You'll have two attempts for each survey question."),
p("Click the Start button when you're ready to begin."),
div(
style = "text-align: center;",
bsButton(
inputId = "go2",
label = "Start",
style = "default",
size = "large",
icon = icon("bolt")
)
)
),
#### Level A ----
tabPanel(
title = "Level A",
br(),
h3("Level A"),
p("Select the appropriate bias for each survey question."),
h4("Survey Question 1"),
uiOutput("questionA1"),
fluidRow(
column(
width = 4,
selectInput(
inputId = "qA1",
label = "Bias Type",
choices = choicesA
)
),
column(
width = 2,
offset = 0,
br(),
uiOutput("ansA1")
),
column(
width = 6,
offset = 0,
br(),
uiOutput("feedbackA1")
)
),
h4("Survey Question 2"),
uiOutput("questionA2"),
fluidRow(
column(
width = 4,
selectInput(
inputId = "qA2",
label = "Bias Type",
choices = choicesA
)
),
column(
width = 2,
offset = 0,
br(),
uiOutput("ansA2")
),
column(
width = 6,
offset = 0,
br(),
uiOutput("feedbackA2")
)
),
h4("Survey Question 3"),
uiOutput("questionA3"),
fluidRow(
column(
width = 4,
selectInput(
inputId = "qA3",
label = "Bias Type",
choices = choicesA
)
),
column(
width = 2,
offset = 0,
br(),
uiOutput("ansA3")
),
column(
width = 6,
offset = 0,
br(),
uiOutput("feedbackA3")
)
),
hr(),
fluidRow(
column(
width = 2,
bsButton(
inputId = "prevA",
label = "Previous",
style = "default",
size = "large",
icon = icon("backward")
)
),
column(
width = 2,
offset = 3,
div(
style = "text-align: center;",
bsButton(
inputId = "submitA",
label = "Submit",
style = "default",
size = "large"
)
)
),
column(
width = 2,
offset = 3,
bsButton(
inputId = "nextA",
label = "Next",
style = "default",
size = "large",
icon = icon("forward"),
disabled = TRUE
)
)
)
),
#### Level B ----
tabPanel(
title = "Level B",
br(),
h3("Level B"),
p("Select the appropriate bias for each survey question."),
h4("Survey Question 1"),
uiOutput("questionB1"),
fluidRow(
column(
width = 4,
selectInput(
inputId = "qB1",
label = "Bias Type",
choices = choicesB
)
),
column(
width = 2,
offset = 0,
br(),
uiOutput("ansB1")
),
column(
width = 6,
offset = 0,
br(),
uiOutput("feedbackB1")
)
),
h4("Survey Question 2"),
uiOutput("questionB2"),
fluidRow(
column(
width = 4,
selectInput(
inputId = "qB2",
label = "Bias Type",
choices = choicesB
)
),
column(
width = 2,
offset = 0,
br(),
uiOutput("ansB2")
),
column(
width = 6,
offset = 0,
br(),
uiOutput("feedbackB2")
)
),
h4("Survey Question 3"),
uiOutput("questionB3"),
fluidRow(
column(
width = 4,
selectInput(
inputId = "qB3",
label = "Bias Type",
choices = choicesB
)
),
column(
width = 2,
offset = 0,
br(),
uiOutput("ansB3")
),
column(
width = 6,
offset = 0,
br(),
uiOutput("feedbackB3")
)
),
hr(),
fluidRow(
column(
width = 2,
bsButton(
inputId = "prevB",
label = "Previous",
style = "default",
size = "large",
icon = icon("backward")
)
),
column(
width = 2,
offset = 3,
div(
style = "text-align: center;",
bsButton(
inputId = "submitB",
label = "Submit",
style = "default",
size = "large"
)
)
),
column(
width = 2,
offset = 3,
bsButton(
inputId = "nextB",
label = "Next",
style = "default",
size = "large",
icon = icon("forward"),
disabled = TRUE
)
)
)
),
#### Level C ----
tabPanel(
title = "Level C",
br(),
h3("Level C"),
p("Select the appropriate bias for each survey question."),
h4("Survey Question 1"),
uiOutput("questionC1"),
fluidRow(
column(
width = 4,
selectInput(
inputId = "qC1",
label = "Bias Type",
choices = choicesC
)
),
column(
width = 2,
offset = 0,
br(),
uiOutput("ansC1")
),
column(
width = 6,
offset = 0,
br(),
uiOutput("feedbackC1")
)
),
h4("Survey Question 2"),
uiOutput("questionC2"),
fluidRow(
column(
width = 4,
selectInput(
inputId = "qC2",
label = "Bias Type",
choices = choicesC
)
),
column(
width = 2,
offset = 0,
br(),
uiOutput("ansC2")
),
column(
width = 6,
offset = 0,
br(),
uiOutput("feedbackC2")
)
),
h4("Survey Question 3"),
uiOutput("questionC3"),
fluidRow(
column(
width = 4,
selectInput(
inputId = "qC3",
label = "Bias Type",
choices = choicesC
)
),
column(
width = 2,
offset = 0,
br(),
uiOutput("ansC3")
),
column(
width = 6,
offset = 0,
br(),
uiOutput("feedbackC3")
)
),
h4("Survey Question 4"),
uiOutput("questionC4"),
fluidRow(
column(
width = 4,
selectInput(
inputId = "qC4",
label = "Bias Type",
choices = choicesC
)
),
column(
width = 2,
offset = 0,
br(),
uiOutput("ansC4")
),
column(
width = 6,
offset = 0,
br(),
uiOutput("feedbackC4")
)
),
hr(),
fluidRow(
column(
width = 2,
bsButton(
inputId = "prevC",
label = "Previous",
style = "default",
size = "large",
icon = icon("backward")
)
),
column(
width = 2,
offset = 3,
div(
style = "text-align: center;",
bsButton(
inputId = "submitC",
label = "Submit",
style = "default",
size = "large"
)
)
),
column(
width = 2,
offset = 3,
bsButton(
inputId = "nextC",
label = "Next",
style = "default",
size = "large",
icon = icon("forward"),
disabled = TRUE
)
)
)
),
#### Final Tab ----
tabPanel(
title = "Final Scores",
h3("Final Scores"),
p("Congratulations on finishing the game!"),
br(),
DT::dataTableOutput(outputId = "finalScores"),
br(),
fluidRow(
column(
width = 2,
offset = 0,
bsButton(
inputId = "prevScores",
label = "Previous",
icon = icon("backward"),
size = "large"
)
),
column(
width = 2,
offset = 3,
bsButton(
inputId = "newGame",
label = "Play Again",
icon = icon("retweet"),
size = "large"
)
)
)
)
)
),
### References Page----
tabItem(
tabName = "References",
withMathJax(),
h2("References"),
p(
class = "hangingindent",
"Bailey, E. (2022). shinyBS: Twitter bootstrap components for shiny.
(v0.61.1). [R package]. Available from https://CRAN.R-project.org/package=shinyBS"
),
p(
class = "hangingindent",
"Carey, R. and Hatfield., N. J. (2023). boastUtils: BOAST utilities.
(v0.1.11.2). [R Package]. Available from
https://github.com/EducationShinyappTeam/boastUtils"
),
p(
class = "hangingindent",
"Chang, W. and Borges Ribeio, B. (2021). shinydashboard: Create dashboards
with 'Shiny'. (v0.7.2). [R Package]. Available from
https://CRAN.R-project.org/package=shinydashboard"
),
p(
class = "hangingindent",
"Chang, W., Cheng, J., Allaire, J.J., Sievert, C., Schloerke, B.,
Xie, Y., Allen, J., McPherson, J., Dipert, A., and Borges, B. (2022).
shiny: Web application framework for R. (v1.7.4). [R Package].
Available from https://CRAN.R-project.org/package=shiny"
),
p(
class = "hangingindent",
"Perrier, V., Meyer, F., and Granjon, D. (2023). shinyWidgets: Custom
inputs widgets for shiny. (v0.7.6). [R Package]. Availble from
https://CRAN.R-project.org/package=shinyWidgets"
),
p(
class = "hangingindent",
"Rollins, B. (1948). Picture Harry S. Truman."
),
p(
class = "hangingindent",
"Wickham, H., François, R., Henry, L., Müller, K., and Vaughan, D.
(2023). dplyr: A grammar of data manipulation. (v1.1.2). [R Package].
Available from https://CRAN.R-project.org/package=dplyr"
),
p(
class = "hangingindent",
"Xie, Y., Cheng, J., and Tan, X. (2023). DT: A wrapper of the
JavaScript library 'DataTables'. (v0.28). [R Package]. Available
from https://CRAN.R-project.org/package=DT"
),
br(),
br(),
br(),
boastUtils::copyrightInfo()
)
)
)
)
)
# Define server logic ----
server <- function(input, output, session) {
## Define player trackers ----
playerScores <- reactiveValues(
intLevelA = 0,
intLevelB = 0,
intLevelC = 0,
finalLevelA = 0,
finalLevelB = 0,
finalLevelC = 0,
aAttempts = 0,
bAttempts = 0,
cAttempts = 0
)
playerBank <- reactiveVal(NULL, label = "Player Question Bank")
## Info button ----
observeEvent(
eventExpr = input$info,
handlerExpr = {
message <- switch(
EXPR = input$pages,
examples = "Click buttons to see improved wordings.",
game = "Test your understanding by identifying the type of bias in the
displayed survey question. You have two attempts for each level.",
"Use the app to explore different ways in which bias can show up in the
wording of survey questions."
)
sendSweetAlert(
session = session,
title = "Instructions",
text = message,
type = "info"
)
}
)
## Go button ----
observeEvent(
eventExpr = input$go1,
handlerExpr = {
updateTabItems(
session = session,
inputId = "pages",
selected = "examples"
)
}
)
## Examples Page Buttons ----
### Deliberate bias ----
observeEvent(
eventExpr = input$fixDeliberateBias,
handlerExpr = {
output$deliberateExample <- renderText({
"Do you agree or disagree that it is hard for today's college graduates
to have a bright future?"
})
}
)
### Filtering bias ----
observeEvent(
eventExpr = input$fixFiltering,
handlerExpr = {
output$filteringExample <- renderUI({
p("What is your opinion of our current President?",
tags$ol(
type = "a",
tags$li("Favorable"),
tags$li("Unfavorable"),
tags$li("Undecided")
)
)
})
}
)
### Anchoring bias ----
observeEvent(
eventExpr = input$fixAnchoring,
handlerExpr = {
output$anchoringExample <- renderText({
"What is the population of Canada?"
})
}
)
### Unintentional bias ----
observeEvent(
eventExpr = input$fixUnintentional,
handlerExpr = {
output$unintentionalExample <- renderText({
"Do you favor or oppose an ordinance that does not allow surveillance
cameras to be placed on Beaver Avenue?"
})
}
)
### Double barrel ----
observeEvent(
eventExpr = input$fixDoubleBarrel,
handlerExpr = {
output$doubleBarrelExample <- renderUI({
p("Who should have priority in receiving the COVID-19 vaccination?",
tags$ol(
type = "a",
tags$li("Health care workers"),
tags$li("Military personnel"),
tags$li("Both health care workers and military personnel"),
tags$li("Neither")
)
)
})
}
)
### Double negative ----
observeEvent(