-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathui.R
1011 lines (981 loc) · 48.8 KB
/
ui.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
library(shiny) # load shiny package
library(shinythemes) # load shinythemes to change the app theme
library(shinyjs) # load shinyjs package to use jav script elements
# library(data.table)
# library(tableHTML)
# Define UI for dataset viewer app ----
ui <- fluidPage(
theme = shinytheme("cosmo"), # define theme
shinyjs::useShinyjs(), # call shinyjs package
# Define CSS for the app
tags$head(tags$style(
HTML(
"
@import url('//fonts.googleapis.com/css?family=Lobster|Cabin:400,700');
h1 {
font-family: \"Georgia\", Times, serif;
font-weight: 500;
line-height: 1.1;
color: #93baff;
position: relative;
background : url(logo6.png) no-repeat 0 0;
}
h3 {
font-family: \"Georgia\", Times, serif;
font-variant: small-caps;
color: #5e67e5;
text-align: center;
}
h4 {
font-family: \"Georgia\", Times, serif;
font-style: italic;
color: #5e67e5;
font-weight: 400;
}
h5 {
font-family: \"Gerogia\", Times, serif;
font-style: italic;
color: #7a6db1;
font-weight: 450;
}
h6 {
font-family: \"Georgia\", Times, serif;
color: #7a6db1;
font-weight: 470;
}
em {
font-weight:italic;
}
p.normal {
font-family: \"Georgia\", Times, serif;
font-variant: normal;
font-size: 10pt;
}
table, th, td {
font-family: \"Georgia\", Times, serif;
border: 1px solid black;
border-collapse: collapse;
padding: 8px;
text-align: center;
}
blockquote{
font-family: \"Georgia\", Times, serif;
font-size: 12pt;
}
.btn {
background-color:#b491f6;
font-family: \"Georgia\", Times, serif;
font-variant: small-caps;
}
.shiny-notification{
position: fixed;
top: 33%;
left: 53%;
right: 33%;
background-color:#c7ccff;
color: #7a6db1;
}
body {
background-color: #fdfaff;
}
"
)
)),
div(
id = "Dapp", # app ID
headerPanel("DscoreApp"), # app Title
sidebarLayout(
# Sidebar panel for inputs
sidebarPanel(
style = "background-color: #e1e9f9;",
# Pop-up menu for the toy dataset checkbox
a(id = "example_det", h4("Example data", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_example",
helpText(
h6("Check this box to use an example Race IAT dataset for computing",
"the D-score.")
)
)),
# Checkbox for the toy dataset (default = F)
checkboxInput("checkbox", HTML("<p class =\"normal\">Race IAT dataset</p>"),
value = FALSE),
# Conditional Panel for importing users' dataframe
conditionalPanel(
condition = "input.checkbox == false",
# data import pop-up menu
a(id = "imp_det", h4("Choose CSV file", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_import",
helpText(
h6("Import data. CSV separator must be comma (,).",
"Please use the template from READ ME FIRST",
"compiled according to instructions.")
)
)),
# Users' data import button
fileInput(
'datafile',
'',
accept = c('text/csv', 'text/comma-separated-values,text/plain')
)
),
# Block labels definition pop-up menu
fluidRow(
column(
5,
a(id = "practice_det_mapA", h4("MappingA Practice block label", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_practice_mapA",
helpText(h6("How did you label the MappingA pratice block?"))
)),
# actual labels for the block, taken from the dataset
uiOutput("label_mapA_practice")
),
column(
5,
a(id = "test_det_mapA", h4("MappingA Test block label", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_test_mapA",
helpText(h6("How did you label the MappingA test block?"))
)),
uiOutput("label_mapA_test")
)
),
fluidRow(
column(
5,
a(id = "practice_det_mapB", h4("MappingB Practice block label", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_practice_mapB",
helpText(h6("How did you label the MappingB pratice block?"))
)),
uiOutput("label_mapB_practice")
),
column(
5,
a(id = "test_det_mapB", h4("MappingB Test block label", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_test_mapB",
helpText(h6("How did you label the MappingB pratice block?"))
)),
uiOutput("label_mapB_test")
)
),
# Upload data button
fluidRow(
column(4,
actionButton("load", "Prepare Data")),
# Pop-up menu for the uploading button and the Data ready message
column(
4,
a(id = "info_prepare", h4("Show info",style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_prepare",
helpText(
h6("Upload and prepare data for calculating the D score \n
When it's finished a message will appear next the button")
)
))
),
# Data are ready message
column(4,
uiOutput("data_ready"))
),
# D-score selection pop-up menu
a(id = "select_D", h4("Show info", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_D",
helpText(h6("Which D-score would you like to compute?"))
)),
# D-score selection
selectInput(
"sel_d",
label = "",
list(
"Select your D" = 0,
"BUILT-IN" = c(
"D1 (Built-in, no lower treatment)" = 1,
"D2 (Built-in, 400ms lower treatment)" = 2
),
"NO BUILT-IN" = c(
"D3 (+2sd error inflation, no lower treament)" = 3,
"D4 (+600ms error inflation, no lower treatment)" = 4,
"D5 (+2sd error inflation, 400ms lower treatment)" = 5,
"D6 (+600ms error inflation, 400ms lower treatment)" = 6
)
)
),
# Accuracy deletion pop-up menu
fluidRow(
column(
4,
a(id = "accuracy_det", h4("Accuracy deletion", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_accuracy",
helpText(
h6("Apply cleaning strategy based on accuracy deletion?")
)
)),
# Accuracy deletion selection (default = 1 = No deletion selected)
radioButtons(
"accuracy_del",
label = "",
choices = list("No" = 1, "Yes (Practice + Test blocks)" = 2),
selected = 1
)
),
# Error percentage threshold pop-up menu
column(
3,
conditionalPanel(
condition = "input.accuracy_del == '2'",
a(id = "percentage_det", h4("Error Percentage", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_perc",
helpText(h6("Choose the error percentage you are willing to accept"))
)),
# error percentage selection
numericInput(
"perc_error",
label = "",
value = 25,
min = 5,
max = 40
)
)
),
# Fast participants deletion pop-up menu
column(
3,
a(id = "sbjFast_det", h4("Fast participants deletion", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_sbjFast",
helpText(
h6("Eliminate participants with more than 10% of responses faster than 300 ms?")
)
)),
# Fast participants deletion selection (default = 1 = No deletion selected)
radioButtons(
"sbjFast_del",
label = "",
choices = list("No" = 1, "Yes" = 2),
selected = 1
)
)
),
# Graphic display of the results (appears only when a D-score is selected)
conditionalPanel(
condition = "input.sel_d != '0'",
# Graphic selection pop-up menu
fluidRow(
column(
4,
a(id = "graph_det", h4("Graphic display", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_graph",
helpText(h6("How would you display your D-scores?"))
)),
# Graphic selection (default = Points graph)
radioButtons(
"graph",
label = "",
choices = list(
"Points" = 1,
"Histogram" = 2,
"Density" = 3,
"Histogram + Density" = 4
),
selected = 1
)
),
# Conditional panel for the participants' display order in the Point graph
column(
5,
conditionalPanel(
condition = "input.graph == '1'",
# Participants' display order in the Point graph pop-up menu
a(id = "point_det", h4("Point Graph", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_point",
helpText(h6("How would you like to order the Participants?"))
)),
# Participants' display order in the Point graph selection (default = None)
selectInput(
"point_opts",
"",
choices = list(
"None" = 1,
"D-score:Increasing" = 2,
"D-score:Decreasing" = 3
),
selected = 1
)
)
)
),
# Conditional panel for number of bins in the histogram graph
conditionalPanel(
condition = "input.graph == '2'",
# Number of bins the histogram graph pop-up menu
a(id = "hist_det", h4("Histogram number of bins", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_histogram",
helpText(h6("Select the number of bins you want"))
)),
# Number of bins the histogram graph selection (default = 30)
sliderInput(
"num.bin",
label = "",
min = 1,
max = 100,
step = 1,
value = 30
)
),
# Conditional panel for number of bins in the histogram + density graph
conditionalPanel(
condition = "input.graph == '4'",
# Number of bins the histogram + density graph pop-up menu
a(id = "hist_det1", h4("Histogram number of bins", style = "font-style: normal; font-size: 11pt;"), href = "#"),
shinyjs::hidden(div(
id = "details_histogram1",
helpText("Select the number of bins you want")
)),
# Number of bins the histogram + density graph selection (default = 30)
sliderInput(
"num.bin1",
label = "",
min = 1,
max = 100,
step = 1,
value = 30
)
)
),
# Include clarifying text
helpText(h6("Note: Please, read the READ ME FIRST before doing anything")),
# D-score calcution/update button
actionButton("update", "Calculate & Update"),
# Restart app button
actionButton("reset", "Reset & Restart"),
# Download results button
downloadButton("downloadData", "Download")
),
# Main panel
mainPanel(tabsetPanel(
tabPanel(
h4("Read Me First"),
# Introduction pop-up menu
a(id = "imp_intro", h3("The D-score Shiny App"), href = "#"),
shinyjs::hidden(div(
id = "details_intro",
HTML(
"
<blockquote>
<p>
This app will help you in computing different
<em>D-score</em>s for the Implicit Association
Test (IAT; Greenwald et al., 1998), according to Greenwald, Nosek and
Banaji (2003). Beyond the computation of the
<em>D-score</em>s <em>per se</em>, the
DShinyApp app generates different graphic
representations which will allow you to observe
how the <em>D-score</em>s change according to
the selected <em>D</em> (e.g.,
the different strategies for the error
replacement), and the different settings you
specified.
<p>
Within the features offered by the app, you can
decide whether to discard participants with
a high proportion of incorrect responses
(Nosek, Banaji & Greenwald, 2002), or
participants with a high percentage of fast
responses (Greenwald et al., 2003), or both.
At the end of your computation, you can download
a file containing all of your participants'
<em>D-score</em>s for further analyses.
<br>
In the following sections, details on the
functioning of the app and its features are
provided.
</p>
</blockquote>"
)
)),
# Import pop-up menu
a(id = "imp_text", h3("Import Data"), href = "#"),
shinyjs::hidden(div(
id = "details_imptext",
HTML(
"
<blockquote>
<p>
Before importing the data:
</p>
<ul>
<li> Remove from the dataset the pure practice
blocks of the IAT (i.e., the blocks in which
only either the target or the attirbute stimuli
are sorted in their reference categories).</li>
<li> The IAT data are in a CSV file with
"," set as separator of the columns.
In the template downloadable at
"Download CSV Template", ","
is already set as the column separator.</li>
<li> Rename the columns according to the
columns' names of the Template file, and define
the variables as follows:</li>
<ul>
<li> <b> participant:</b> it defines the
ID of the participants. The IDs may be either
numeric (e.g., 1,2,..300...450) or a string
(e.g., ss01, aa05, JohnDoe1001 etc.). </li>
<li> <b> block: </b> It defines the blocks
of the IAT. The labels identifying each block
are not importart <em>per se</em>. The important
thing is that each block is defined by a unique
label, hence there have to be <em><strong>four
distinct labels</strong></em> defining the
<em>practice</em> and <em>test </em> blocks of
<strong> Mapping A </strong>(e.g.,
practiceWhiteGood, testWhiteGood) and the
<em>practice</em> and <em>test</em> block of
<strong> Mapping B</strong> (e.g.,
practiceWhiteBad, testWhiteBad). </li>
<li> <b> latency: </b> It contains the
latencies of the responses expressed in
millisecond. If the IAT <b>DID NOT include a
built-in</b> correction, place the raw
latencies in this variable. If the IAT
<b>DID include a built-in</b> correction,
please place the <b>already inflated</b>
latency of the error responses.</li>
<li><b> correct: </b> It contains the correct
and error responses to the IAT. Correct responses
have to be coded as 1, error responses have to
be coded as 0. </li>
</ul>
</ul> <br>
Summarizing, for using the App it is fundamental
that the dataset contains the four abovementioned
variables with the specific associated names.
</blockquote>"
),
# Download template button
fluidRow(column(
3,
offset = 8,
downloadButton("downloadTemplate", "Download CSV Template")
))
)),
# App functioning pop-up menu
a(id = "det_works", h3("How it works"), href = "#"),
shinyjs::hidden(div(
id = "details_works",
HTML(
"
<blockquote>
<p> The app is provided with a toy dataset
containing data from a Race IAT. If you check
the "Race IAT dataset" box, the data
will be automatically loaded in the server, and
the <em>D-score</em> can be computed.
Otherwise, you can import your dataset by
following these instructions:</p>
<ul>
<li> Use the <b>"Browse"</b> function
to select your data. </li>
<li> Select the labels of the <em>practice</em>
and <em>test</em> blocks of both <b>Mapping A</b>
and <b>Mapping B</b> from the dropdown menu.
The dropdown menu for each of
the four levels defining the blocks will display
the labels in your dataset for each of the
<em>practice</em> and <em>test</em> blocks of
both <strong>Mapping A</strong> and
<strong>Mapping B</strong>.</li>
<li> Once the labels identifying
the correct blocks are selected, the <b>"Prepare data"</b>
button is activated. Click on the
<b>"Prepare data"</b> button and wait
for the alert <b>"Data are ready!"</b>
to appear right next to the button itself. <br>
If there is something wrong with the block labels,
an alert message will appear. In such cases,
please check carefully the labels in your dataframe and restart the
app.</li>
<li> At this point, data are ready for the
computation of the <em>D-score</em>. The
following table contains the computation details for
each <em>D-score</em>.
If your data <b>DO contain a built-in</b>
correction, you can choose <b> only
</b>between <em>D1</em> and <em>D2</em>. If
your data <b> DO NOT contain a built-in
</b>correction, you can choose between
all the other <em>D-score</em>s.</li>
</ul>
<p>
The App can be resetted by clicking on the
<b> "Reset & Restart"</b> button.
</p>
</blockquote>"
),
# D-scores table
HTML(
"<blockquote>
<center>
<table>
<tr>
<th>Dscore</th>
<th>Error inflation</th>
<th>Lower tail treatment</th>
</tr>
<tr>
<td>D1</td>
<td>Built-in correction</td>
<td>No</td>
</tr>
<tr>
<td>D2</td>
<td>Built-in correction</td>
<td>delete trials < 400 ms</td>
</tr>
<tr>
<td>D3</td>
<td>Replace errors: mean (correct responses) + 2sd</td>
<td>No</td>
</tr>
<tr>
<td>D4</td>
<td>Replace errors: mean (correct responses) + 600 ms</td>
<td>No</td>
</tr>
<tr>
<td>D5</td>
<td>Replace errors: mean (correct responses) + 2sd</td>
<td>delete trials < 400 ms</td>
</tr>
<tr>
<td>D6</td>
<td>Replace errors: mean (correct responses) + 600 ms</td>
<td>delete trials < 400 ms</td>
</tr>
</table>
</center>
<br>
<b>"Dscore"</b> refers to the
<em>D-score</em> you can find in the
<b>"Select your D"</b> dropdown menu,
<b>"Error inflation"</b> refers to the
treatment for the error responses, and
<b>"Lower tail treatment"</b> is the
tretament for the fast responses. For all the
<em>D-score</em> procedures, the responses with
a latency over 10,000 ms have been discarded.
</br>
For any further details on the different
strategies for the <em>D-score</em>
computation, please refer to Greenwald et al.
(2003).
</p>
<p>
The D-score is computed as <b>Mapping B</b> -
<b>Mapping A</b>.
</blockquote>"
),
# data.table("Dscore" = paste0("D", 1:6),
# "Error inflation" = c(rep("Built-in", 2), "Error Mean + 2sd",
# "Error Mean + 600 ms", "Error Mean + 2sd",
# "Error Mean + 600 ms"),
# "Lower Tail treatment" = c("No", "Yes" , "No", "No", "Yes", "Yes")) %>%
# tableHTML(rownames = FALSE,
# widths = rep(250, 3),
# caption = "Table 1: foo bar") %>%
# add_css_table(css = list("text-align", "center")) %>%
# add_css_row(css = list(c("background-color", "color"),
# c("red", "white"), rows= 2:3)),
# # add_css_header(headers = 1:3,
# # css = list(c("background-color", "color"),
# # c("red", "white"))) %>%
# # add_css_caption(css = list("color", "purple")),
HTML(
" <blockquote>
<ul>
<li> Once a <em>D-score</em> is selected from the
dropdown menu, the
<b>"Compute & Update"</b> button
becomes usable.
</br>When the <b>"Compute & Update"</b>
button is clicked, the results appear in the
"<em>D-score</em> results" panel. </li>
<li> You can decide to display all participants'
<em>D-scores</em> (default) or to exclude the
ones with an high percentage of error responses
(<b>"Accuracy deletion"</b> option) or
a high rate of fast responses
(<b>"Fast participants cleaning"</b>
option), or both. </li>
Whether you decide to display all the
participants' <em>D-score</em> or not, ALL the
participants will be included in the
downloadable file.
<li> Everytime you make a change, remember to
click on the
<b>"Compute & Update"</b>,
otherwise no changes will happen.</li>
<li>When you want to download your file, click
on the <b>"Download"</b> button.
This file will contain the <b>lastly computed
<em>D-score</em></b>. For further information
on the downloadable file, please read the
<em>"What you get section"</em>.</li>
</ul>
</blockquote>"
)
)),
# Results panel pop-up menu
a(id = "det_dpanel", h3("The D-score results panel"), href = "#"),
shinyjs::hidden(div(
id = "details_dpanel",
HTML(
"
<blockquote>
<ul>
<li> <b><em>D-score</em>:</b> Graphics
display of the <em>D-score</em>s of the
participants, according to the specified
options. </li>
<li> <b> Point (Only for point graph):</b>
Click on a point of the graph: The participant's
<em>D-score</em> and ID corresponding to the point
will appear in the box. </li>
<li> <b> Area (for all the other graphic
display):</b> Highlight an area of the graph:
The <em>D-score</em>s and IDs of the Participants
included in the selected area will appear in the
box. </li>
<li> <b> Summary:</b> Displays the summary
statistics (<em>Minimum, 1st quartile, Median,
Mean, 3rd quartile, Maximum</em>) of the
practice and test blocks <em>D</em>s, along
with the actual <em>D-score</em>. </li>
<li> <b> Trials > 10,000 ms: </b>
Displays the number of trials with a
latency > 10,000 ms.</li>
<li> <b> Trials < 400 ms: </b>Displays
the number of trials with a latency < 400 ms.
If the selected <em>D-score</em> did not include
the lower tail treamentment, the message
"Not expected for this D" will appear
in the box.</li>
<li> <b> Accuracy deletion:</b> Appears
only if the <b>"Accuracy deletion"</b> option is selected.
It displays the number of Participants (if any)
discarded because of an error response percentage
greater than a given percentage
(default 25%). </li>
<li> <b> Participants < 300 ms: </b>
Appears only when <b>"Fast participants cleaning"</b> is
selected. It displays the number of participants
with more than 10% of responses under 300
ms.</li>
<li> <b> Practice-Test reliability: </b>
Displays the IAT reliability computed as the
correlation between the <em>D</em>s in the
practice and test blocks (Gawronski et al., 2017). </li>
</ul>
<p>
Please refer to the <a href=https://implicit.harvard.edu/implicit/demo/copyright.html>Project Implicit Website</a> for the
interpretation guidelines of the <em>D-score</em>s effect size
reported in the graphs.
</p>
</blockquote>"
)
)),
# Descriptive statistics pop-up menu
a(
id = "det_descriptive",
h3("Descriptive statistics panel"),
href = "#"
),
shinyjs::hidden(div(
id = "details_descriptive",
HTML(
"
<blockquote>
The third and last panel of the App includes
the descriptive statistics of the data, always
updated to the last settings specified:
<p>
<ul>
<li><b> Average response time:</b> It
contains the descriptive statistics (<em>
Minimum, 1st quartile, Median, Mean, 3rd
quartile, Maximum </em>) of the response times
in the two mapping conditions
(<b>"mappingA"</b>, and
<b>"mappingB"</b>, first two rows), in
practice and test blocks
(<b>"practice"</b> and
<b>"test"</b>, third and fourth row),
and in the four blocks of the IAT
(<b>"practice.MappingA"</b>,
<b>"practice.MappingB"</b>,
<b>"practice.MappingB"</b>,
<b>"test.MappingB"</b>).</li>
<li><b> Accuracy: </b> Contains the
proportion of correct responses
("Proportion_correct") in the two
mapping conditions (<b>"mappingA"</b>,
and <b>"mappingA"</b>, first two rows),
in practice and test blocks
(<b>"practice"</b> and
<b>"test"</b>, third and fourth row),
and in the four blocks of the IAT
(<b>"practice.MappingA"</b>,
<b>"practice.MappingB"</b>,
<b>"practice.MappingB"</b>,
<b>"test.MappingB"</b>).</li>
</ul>
</p>
</blockquote>"
)
)),
# Downloadable file pop-up menu
a(id = "det_getting", h3(" What you get"), href = "#"),
shinyjs::hidden(div(
id = "details_getting",
HTML(
"
<blockquote>
<p>
The CSV you will obtain contains the following
information. Each column refers
to the observed values for each participant.
</p>
<ul>
<li><b>participant:</b> Participants ID. </li>
<li><b>n_trial:</b> IAT total number of
trials<b> before data cleaning</b>. </li>
<li><b>slow10000:</b> # of trials
> 10,000 ms. </li>
<li><b>num.300:</b> # of trials
< 300 ms. </li>
<li> <b>num.400:</b> # of trials
< 400 ms. </li>
<li><b>mean.tot:</b> Overall mean
latency for each participant. </li>
<li><b>p_correct_block.practice.MappingA:</b>
Proportion of correct responses in practice
block of Mapping A. </li>
<li><b>p_correct_block.practice.MappingB:</b>
Proportion of correct responses in practice block
of Mapping B. </li>
<li><b>p_correct_block.test.MappingA: </b>
Proportion of correct responses in test block
of Mapping A. </li>
<li><b>p_correct_block.test.MappingB: </b>
Proportion of correct responses in test block
of Mapping B. </li>
<li><b>p_correct_bpool.practice: </b>
Proportion of correct responses practice blocks
(Mapping A + Mapping B)</li>
<li><b>p_correct_bpool.test: </b>
Proportion of correct responses test blocks
(Mapping A + Mapping B).</li>
<li><b>prop_correct_cond_MappingA: </b>
Proportion of correct responses in Mapping A.</li>
<li><b>prop_correct_cond_MappingB: </b>
Proportion of correct responses in Mapping B. </li>
<li><b>p_correct_tot: </b>Overall
proportion of correct responses. </li>
<li><b>d_practice.#:
</b><em>D-score</em> computed on practice blocks.</li>
<li><b>d_test.#: </b><em>D-score</em>
computed on test blocks. </li>
<li><b>dscore.#: </b><em>D-score</em>.</li>
<li><b>cond_ord: </b>Order of condition
presentation. </li>
<li><b>LegendMappingA: </b> Informs you
about what "MappingA "corresponds
according to your labels.</li>
<li><b>LegendMappingB:</b> Informs you
about what "MappingB "corresponds
according to your labels.</li>
</ul>
The # next to "d_test",
"d_practice", and "dscore"
indicates the number corresponding to the last
computed <em>D-score</em>. For instance, if you
lastly selected the "D5", a "5"
will be printed next to the labels,
resulting in "d_test<b>.5</b>",
"d_practice<b>.5</b>",
and "dscore<b>.5</b>".
</blockquote>"
)
)),
# Final remarks, references, Contact, and License pop-up menu
a(
id = "det_references",
h3("References"),
href = "#"
),
shinyjs::hidden(div(
id = "details_references",
HTML(
"
<p>
Gawronski, B., Morrison, M., Phills, C. E., & Galdi, S. (2017). Temporal stability of
implicit and explicit measures:
A longitudinal analysis. <em> Personality and Social Psychology Bulletin, 43</em>(3), 300-312.
doi: 10.1177/0146167216684131
</p>
<p>
Greenwald, A. G., McGhee, D. E., & Schwartz, J. L. K. (1998). Measuring Individual Differences in
Implicit Cognition: The Implicit Association Test. <em>Journal of Personality and Soclal Psychology,
74</em>(6). doi: 10.1037/0022-3514.74.6.1464
</p>
<p>
Greenwald, A. G., Nosek, B. A., & Banaji,
M. R. (2003). Understanding and using the
implicit association test: I. An improved
scoring algorithm. <em>Journal of personality
and social psychology, 85</em>(2), 197-216.
doi: 10.1037/0022-3514.85.2.197
</p>
<p>
Nosek, B. A., Banaji, M. R., & Greenwald,
A. G. (2002). Harvesting implicit group
attitudes and beliefs from a demonstration web
site.<em> Group Dynamics: Theory, Research,
and Practice, 6</em>(1), 101-115.
doi: 10.1037/1089-2699.6.1.101
</p>
"
)
)),
a(
id = "det_contacts",
h3("Contacts"),
href = "#"
),
shinyjs::hidden(div(
id = "details_contacts",
HTML(
"
<blockquote>
This App was developed by Ottavia M. Epifania
at the University of Padova (Italy). The source code of the app
and the raw data are available on my <a href=https://github.com/OttaviaE/DscoreApp>GitHub page</a>.
For any further information on the App functioning or
for any problems regarding the App,
please contact me at: [email protected]
</blockquote>
"
)
)),
a(
id = "det_license",
h3("License"),
href = "#"
),
shinyjs::hidden(div(
id = "details_license",
HTML(
"
<blockquote>
This app is a free software, and you can redistribute it and or modify it under the terms of the
<a href=https://opensource.org/licenses/MIT>MIT license</a>.
</blockquote>
"
)
))
),
# Results Panel
tabPanel(
h4("D- Score results"),
# Graphic representation of the results
plotOutput(
"distribution",
click = clickOpts(id = "plot1_click"), # define graph clicker
brush = brushOpts(id = "plot1_brush") # define area selection
),
# Download plot button
fluidRow(column(3,
offset = 9,
downloadButton("down_plot", "Download Plot"))),
# Conditional panel for displaying the clicker or area results
fluidRow(
conditionalPanel(
# Point clicker apperas only when the point graph is selected
condition = "input.graph == '1'",
column(4,
h5("Points"),
verbatimTextOutput("click_info")),
# Graph area selection always appears
column(4,
h5("Area"),
verbatimTextOutput("brush_info"))
),
conditionalPanel(condition = "input.graph != '1'",
h5("Area"),
verbatimTextOutput("info_hist"))
),
# Summary statistics of the results
fluidRow(
column(6,
h5("Summary"),
verbatimTextOutput("summary")),
# Number of trials slower than 10,000 ms
column(2,
h5("Trials > 10,000ms"),
verbatimTextOutput("slow")),
# Number of trials faster than 400 ms
column(2,
h5("Trials < 400ms"),
verbatimTextOutput("fast")),
# Conditional panel for the number of participants exceeding the accuracy deletion percentage
column(
2,
conditionalPanel(
condition = "input.accuracy_del == '2'",
h5("Accuracy deletion"),
verbatimTextOutput("mistakes")
)
),
# Conditional panel for the number of participants exceeding the 10 % of fast responses threshold
conditionalPanel(condition = "input.sbjFast_del == '2'",
column(
2,
h5("Participants < 300ms"),
verbatimTextOutput("sbjFast")
))
),
# Practice-Test IAT reliability
h5(
"Practice - Test reliability",
verbatimTextOutput("pt_reliability")
)
),
# Descriptive statistics Panel
tabPanel(
h4("Descriptive Statistics"),
fluidRow(column(
10,
h5("Average response times"),
verbatimTextOutput("mean.block")
)),