-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
550 lines (423 loc) · 27.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
library(shiny)
library(tidyverse)
library(readxl)
library(shinythemes)
library(shinyjs)
library(shinyscreenshot)
# install.packages("remotes")
#remotes::install_github("deepanshu88/shinyDarkmode")
library(shinyDarkmode)
################################################################################
#data <- readxl::read_excel("Shiny_Data.xlsx")
data <- readRDS("wwc-shiny-13Sep2023.RDS")
################################################################################
jscode <- "shinyjs.refresh_page = function() { history.go(0); }"
shinyUI(
fluidPage(
theme = shinythemes::shinytheme("lumen"),
#use_darkmode(),
tags$head(HTML("<title>Sensitivity Analysis Benchmarks: What Works Clearinghouse</title><link rel='icon' href='konfound-logo-rectangle.png' type='image/gif/png'>"),
tags$script(src="script.js"),
tags$style(HTML("
/* import Google fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Victor+Mono&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100;0,200;0,300;0,400;1,100;1,200;1,300;1,400');
@import url('https://fonts.googleapis.com/css2?family=Cardo:wght@400;700&family=Cormorant:wght@400;700&family=Nanum+Myeongjo:wght@400;700;800&family=Playfair+Display+SC:wght@400;700;900&family=Roboto+Slab:wght@100;400;700;800;900&display=swap');
/* change page background as well as header and footer text */
body {
background-color: #fff;
font-family: 'Roboto', sans-serif;
font-size: 18px;
font-weight: 300;
color: #000;
}
/* change page title */
h2 {
font-family: 'Raleway', serif;
font-size: 76px;
font-weight: 400;
color: #639dad; /* theme blue color */
}
/* change page first-level headings (e.g., Specification, Results) */
h3 {
font-family: 'Roboto', sans-serif;
font-size: 32px;
font-weight: 700;
color: #7f9f3d; /* theme green color */
}
/* change page second-level headings */
h4 {
font-family: 'Roboto', sans-serif;
font-size: 24px;
font-weight: 700;
color: #000;
}
/* change page third-level headings */
h5 {
font-family: 'Roboto', sans-serif;
font-size: 18px;
color: #000;
}
/* change hyperlink text */
a {
color: #0645ad; /* standard blue hyperlink color */
font-weight: 400;
}
/* change hyperlink hover text */
a:hover {
color: #e04300;
text-decoration: underline;
}
/* change multiple choice text */
.shiny-input-container {
color: #000;
font-size: 16px;
}
/* change navigation bar */
.navbar-default {
background-color: #639dad;
border-color: #999;
font-size: 18px;
font-weight: 300;
}
.navbar-nav > .active {
background-color: #7f9f3d;
}
/* change text in navigation bar: active tab */
.navbar-nav > .active > a {
color: #fff !important;
}
/* change text in navigation bar: inactive tab */
.navbar-nav > li > a {
color: #eee !important;
}
/* change background of area for user input */
.well {
background-color: #fff !important;
}
/* change rows in area for user input */
.row {
background-color: #fff !important;
}
/* change color of most buttons */
#startover_button, #results_pg_l,
#results_pg_pse, #results_pg_cop,
#results_pg_di, #results_pg_2x2 {
background-color: #7f9f3d !important;
color: #fff !important;
font-family: 'Roboto', sans-serif;
font-size: 22px;
}
/* change hover color of most buttons */
#startover_button:hover, #results_pg_l:hover,
#results_pg_pse:hover, #results_pg_cop:hover,
#results_pg_di:hover, #results_pg_2x2:hover {
background-color: #465723 !important;
color: #fff !important;
font-family: 'Roboto', sans-serif;
}
/* change radio buttons */
label > input[type='radio'] {
opacity: 1;
position: absolute;
}
label > input[type='radio'] + *::before {
content: '';
margin: 4px 0 0;
width: 13px;
height: 13px;
position: absolute;
margin-left: -20px;
border-radius: 50%;
border-style: solid;
border-width: 0.1rem;
border-color: #639dad;
}
label > input[type='radio']:checked + *::before {
background: radial-gradient(#7f9f3d 0%, #7f9f3d 50%, transparent 50%) !important;
border-color: #639dad !important;
}
label > input[type='checkbox'] {
opacity: 1;
position: absolute;
}
label > input[type='checkbox'] + *::before {
content: '';
position: absolute;
margin: 4px 0 0;
margin-left: -20px;
align: center;
width: 13px;
height: 13px;
margin-right: 1rem;
border-radius: 0%;
border-style: solid;
border-width: 0.1rem;
border-color: #639dad !important;
}
label > input[type='checkbox']:checked + *::before {
content: '';
width: 13px;
height: 13px;
border-color: #639dad !important;
background: #7f9f3d !important;
}
/* change text on info button */
[id*=info] {
background-color: #639dad !important;
color: #fff !important;
font-family: 'Roboto', sans-serif;
text-shadow: -.0px 0 #fff, 0 .0px #fff, .0px 0 #fff, 0 -.0px #fff;
}
/* change color of visit website button */
#visit_website_button {
background-color: #7f9f3d !important;
color: #fff !important;
font-family: 'Roboto', sans-serif;
font-size: 16px;
}
/* change hover color of visit website button */
#visit_website_button:hover {
background-color: #465723 !important;
color: #fff !important;
font-family: 'Roboto', sans-serif;
}
/* change color of screenshot button */
[id*=screenshot] {
background-color: #7f9f3d !important;
color: #fff !important;
font-family: 'Roboto', sans-serif;
font-size: 22px;
}
/* change hover color of screenshot button */
[id*=screenshot]:hover {
background-color: #465723 !important;
color: #fff !important;
font-family: 'Roboto', sans-serif;
}
"
)
)
),
################################################################################
titlePanel(title = div(img(style = "height:0.75em; vertical-align:center; margin-bottom: 18px;",
src = "konfound-logo-rectangle.png",
alt = "Konfound R package logo"),
"Sensitivity Analysis Benchmarks")),
h3("Data from What Works Clearinghouse"),
tags$p(actionButton("visit_website_button",
icon = icon("globe", lib = "font-awesome"),
label = "KonFound-It website",
onclick = "window.open('https://konfound-it.org/', '_blank')")
),
### For refresh button:
useShinyjs(),
extendShinyjs(text = jscode, functions = "refresh_page"),
navbarPage("",
tabPanel(div(icon("house", lib = "font-awesome"), " Home"),
sidebarLayout(
sidebarPanel(
fluidRow(
align = "center",
h3("Specification")),
selectInput("selectedStudyDesign", "Choose a Study Design:",
#choices = c("All", setdiff(unique(data$s_Study_Design), c(NA, "?", "Uncertain"))),
choices = c("All",
"Randomized Controlled Trial" = "RCT",
"Quasi-Experiment" = "QE"),
selected = "All"),
selectInput("selectedDomain", "Choose an Outcome Domain Group:",
#choices = c("All", sort(setdiff(unique(data$`Outcome Domain Group Expanded`), c(NA, "?", "Uncertain")))),
# choices = list(
# "Primary Domains" = c("All", sort(unique(data$`Outcome Domain Group`))),
# "Sub-Domains of Academic Readiness" = c(unique(data$`Outcome Domain Group Expanded`)),
# ),
# selected = "All"),
choices = list(
#"Main Domains" = c("A", "B", "C"),
"Main Domains" = c("All", sort(unique(data$`Outcome Domain Group`))),
#"Sub-Domains of A" = c("A1", "A2", "A3")
#"Sub-Domains of A" = unique(data$`Outcome Domain Group Expanded`)
"Sub-Domains of Academic Readiness" = c("Literacy" = "ARKS - Literacy",
"Mathematics" = "ARKS - Mathematics",
"Science" = "ARKS - Science",
"Social Studies" = "ARKS - Social Studies")
)
),
selectInput("selectedDichCont", "Choose Dichotomous or Continuous Outcome Measures:",
choices = c("All", setdiff(unique(data$outcome_type), c(NA, "?", "Uncertain"))),
selected = "All"),
selectInput("selectedFindingRating", "Choose WWC Finding Rating:",
choices = c("All", setdiff(unique(data$f_Finding_Rating), c(NA, "?", "Uncertain"))),
selected = "All"),
selectInput("selectedVariable", "Choose a Sensitivity Measure:",
choices = c("Robustness of Inferences to Replacement (RIR)" = "RIR_primary",
"RIR as a percentage of Sample Size" = "RIR_percent",
"Fragility (dichotomous only)" = "fragility_primary.lo",
"Unselected"),
selected = "Unselected")
),
mainPanel(
fluidRow(
align = "center",
h3("Output")),
wellPanel(
h4("Distribution"),
plotOutput("histPlot", height = "400px"),
),
wellPanel(
h4("Place Your Value in the Distribution"),
numericInput("userValue", "Enter your value:", value = NULL),
textOutput("percentileResult")
),
wellPanel(
h4("Descriptive Statistics"),
div(
style = "overflow-x: auto;",
tableOutput("descriptiveStatsTable")
),
),
column(12,
screenshotButton(inputId = "screenshot_button",
label = " Take Screenshot"),
actionButton(inputId = "startover_button",
label = div(icon("rotate-right", lib = "font-awesome"),
" Start Over")),
align = "right"
)
),
),
),
################################################################################
tabPanel(div(icon("screwdriver-wrench", lib = "font-awesome"), " Resources"),
tags$h4("Overall"),
tags$ul(
tags$li(icon("globe", lib = "font-awesome"),
"Learn more on the",
tags$a(href="https://konfound-it.org/", "KonFound-It website.")),
tags$li(icon("paper-plane", lib = "font-awesome"),
"Questions? Issues? Suggestions? Reach out through the",
tags$a(href="https://groups.google.com/g/konfound-it", "KounFound-It! Google Group.")
)
),
hr(),
tags$h4("Tools"),
tags$ul(
tags$li(tags$a(href="https://CRAN.R-project.org/package=konfound", "R package (CRAN version)")),
tags$li(tags$a(href="https://github.com/konfound-project/konfound", "R package (development version)")),
tags$li(tags$a(href="https://konfound-project.shinyapps.io/konfound-it/", "R Shiny app")),
tags$li(tags$a(href="https://doi.org/10.1177/1536867X19874223", "Stata package")),
tags$li(tags$a(href="https://konfound-project.shinyapps.io/wwc-sensitivity-benchmark/", "Sensitivity Analysis Benchmarks: Data from What Works Clearinghouse"), "[BETA]")
),
hr(),
tags$h4("Explanatory Resources"),
tags$ul(
tags$li(tags$a(href="https://konfound-it.org/page/faq/", "FAQ")),
tags$li(tags$a(href="https://www.dropbox.com/s/33zkk861g04hocf/Overview%20of%20Konfound%20commands%20with%20inputs%20and%20outputs.docx?dl=0", "Overview of pkonfound commands")),
tags$li(tags$a(href="https://drive.google.com/file/d/1qbRx2penqzb7kEJkxJD3ARf26CjXMhzg/view", "Quick examples")),
tags$li(tags$a(href="https://www.dropbox.com/s/o67e7w2sm8uww18/quantifying%20the%20robustness%20of%20causal%20inferences%20combined%20frameworks%20for%20stat%20horizons%20distribute.pptx?dl=0", "Powerpoint quantifying the robustness of causal inferences combined frameworks")),
tags$li(tags$a(href="https://www.dropbox.com/s/8t6x00mokkljksh/quantifying%20the%20robustness%20of%20causal%20inferences%20%20comparison%20of%20frameworks.pptx?dl=0", "Powerpoint for comparison of frameworks")),
),
hr(),
tags$h4("Resources for Publication"),
tags$ul(
tags$li(tags$a(href="https://www.dropbox.com/s/bc4ert79kgbsac4/Examples%20of%20applications%20of%20indices%20for%20quantifying%20the%20robustness%20of%20causal%20inferences.docx?dl=0", "Published empirical examples")),
tags$li(tags$a(href="https://www.dropbox.com/s/accoz5xu82vy27v/KonFound-it%21%20enhanced.xlsx?dl=0", "Spreadsheet for calculating indices (KonFound-it!)")),
),
hr(),
tags$h4("Publications: Impact Threshold for a Confounding Variable"),
tags$ul(
tags$li("Frank, K. (2000). Impact of a confounding variable on the inference of a regression coefficient.",
tags$i("Sociological Methods and Research, 29"),
"(2), 147-194. | ",
tags$a(href="https://drive.google.com/file/d/1F7oGYZ8SS8hnZxSI3Dch_w65Qz6KIRdI/view", icon("file-pdf", lib = "font-awesome"), "PDF post-print"), " | ",
tags$a(href="https://doi.org/10.1177/0049124100029002001", icon("globe", lib = "font-awesome"), "Web version"),
),
tags$li("Frank, K. A., Sykes, G., Anagnostopoulos, D., Cannata, M., Chard, L., Krause, A., & McCrory, R. (2008). Does NBPTS certification affect the number of colleagues a teacher helps with instructional matters?.",
tags$i("Educational Evaluation and Policy Analysis, 30"),
"(1), 3-30. | ",
tags$a(href="https://drive.google.com/file/d/1aOvAXEVnQCe9-dbWkgTqtq56Y3Z1tpkg/view", icon("file-pdf", lib = "font-awesome"), "PDF post-print"), " | ",
tags$a(href="https://doi.org/10.3102/0162373707313781", icon("globe", lib = "font-awesome"), "Web version"),
)
),
hr(),
tags$h4("Publications: Robustness of Inference to Replacement"),
tags$ul(
tags$li("Frank, K. A., Lin, Q., Maroulis, S., Mueller, A. S., Xu, R., Rosenberg, J. M., Hayter, C. S., Mahmoud, R. A., Kolak, M., Dietz, T., & Zhang, L. (2021). Hypothetical case replacement can be used to quantify the robustness of trial results.",
tags$i("Journal of Clinical Epidemiology, 134"),
", 150-159. (authors listed alphabetically.) | ",
tags$a(href="https://www.dropbox.com/s/2dzkvalwmgr5v5z/Hypothetical%20case%20replacement%20can%20be%20used%20to%20quantify%20the%20robustness%20of%20trial%20results%20submit.docx?dl=0", icon("file-pdf", lib = "font-awesome"), "PDF post-print"), " | ",
tags$a(href="https://doi.org/10.1016/j.jclinepi.2021.01.025", icon("globe", lib = "font-awesome"), "Web version"),
),
tags$li("Frank, K. A., Maroulis, S. J., Duong, M. Q., & Kelcey, B. M. (2013). What would it take to change an inference? Using Rubin’s causal model to interpret the robustness of causal inferences.",
tags$i("Educational Evaluation and Policy Analysis, 35"),
"(4), 437-460. | ",
tags$a(href="https://drive.google.com/file/d/1aGhxGjvMvEPVAgOA8rrxvA97uUO5TTMe/view", icon("file-pdf", lib = "font-awesome"), "PDF post-print"), " | ",
tags$a(href="https://doi.org/10.3102/0162373713493129", icon("globe", lib = "font-awesome"), "Web version"),
),
tags$li("Frank, K. A., & Min, K. (2007). Indices of robustness for sample representation.",
tags$i("Sociological Methodology. 37"),
"(1). 349-392. (equal first authors.) | ",
tags$a(href="https://www.dropbox.com/s/o0rmduhe8pj3khd/INDICES%20OF%20ROBUSTNESS%20FOR%20SAMPLE%20REPRESENTATION.pdf?dl=0", icon("file-pdf", lib = "font-awesome"), "PDF post-print"), " | ",
tags$a(href="https://doi.org/10.1111/j.1467-9531.2007.00186.x", icon("globe", lib = "font-awesome"), "Web version"),
)
),
hr(),
tags$h4("Publications for Both Frameworks"),
tags$ul(
tags$li("Frank, K.A., Lin, Q., Xu, R., Maroulis, S.J., Mueller, A. (2023). Quantifying the robustness of causal inferences: Sensitivity analysis for pragmatic social science.",
tags$i("Social Science Research, 110"),
", 102815. | ",
tags$a(href="https://www.dropbox.com/s/rn8a4jbxtiynefh/Quantifying%20the%20Robustness%20of%20Causal%20Inferences%20Frank%20SSR%20final.pdf?dl=0", icon("file-pdf", lib = "font-awesome"), "PDF post-print"), " | ",
tags$a(href="https://doi.org/10.1016/j.ssresearch.2022.102815", icon("globe", lib = "font-awesome"), "Web version"),
),
tags$li("Narvaiz, S., Lin, Q., Rosenberg, J. M., Frank, K. A., Maroulis, S. J., Wang, W., & Xu, R. (2024). konfound: An R sensitivity analysis package to quantify the robustness of causal inferences.",
tags$i("Journal of Open Source Software, 9"),
"(95), 5779. | ",
tags$a(href="https://doi.org/10.21105/joss.05779", icon("globe", lib = "font-awesome"), "Web version"),
),
tags$li("Xu, R., Frank, K. A., Maroulis, S. J., & Rosenberg, J. M. (2019). konfound: Command to quantify robustness of causal inferences.",
tags$i("The Stata Journal, 19"),
"(3), 523–550. | ",
tags$a(href="https://www.researchgate.net/profile/Ran-Xu-6/publication/335956720_konfound_Command_to_quantify_robustness_of_causal_inferences/links/5e49a3d2a6fdccd965ac3564/konfound-Command-to-quantify-robustness-of-causal-inferences.pdf", icon("file-pdf", lib = "font-awesome"), "PDF post-print"), " | ",
tags$a(href="https://doi.org/10.1177/1536867X19874223", icon("globe", lib = "font-awesome"), "Web version"),
)
),
hr(),
tags$h4("Connect"),
tags$ul(
tags$li("Project Overview and Details: Peruse the",
tags$a(href="https://konfound-it.org/", "KonFound-It! Website")),
tags$li("Frequently Asked Questions: Check the",
tags$a(href="https://konfound-it.org/page/faq/", "FAQ page"),
"|",
tags$a(href="https://www.dropbox.com/s/9eymdekym5g50o7/frequently%20asked%20questions%20for%20application%20of%20konfound-it.docx?dl=0", "FAQ dev version")),
tags$li("Specific Questions: Ask in the", tags$a(href="https://groups.google.com/g/konfound-it", "KounFound-It! Google Group")),
tags$li("Issues with the konfound R Package: Post to", tags$a(href="https://github.com/konfound-project/konfound/issues", "konfound GitHub Issues")),
tags$li("Overall KonFound-It! Project Inquiries: Contact", tags$a(href="https://msu.edu/~kenfrank/", "Ken Frank")),
tags$li("Benchmarks: What Works Clearinghouse: Contact", tags$a(href="http://www.public.asu.edu/~smarouli/Spiro_Maroulis/Home.html", "Spiro Maroulis")),
tags$li("R Package: Contact", tags$a(href="https://www.linkedin.com/in/qinyun-lin-b72763112/", "Qinyun Lin")),
tags$li("R Shiny App: Contact", tags$a(href="https://joshuamrosenberg.com/", "Joshua Rosenberg")),
tags$li("Stata Package: Contact", tags$a(href="https://sites.google.com/site/ranxupersonalweb/", "Ran Xu")),
tags$li("User Guide: Contact", tags$a(href="https://www.cgu.edu/people/guan-saw/", "Guan Saw")),
tags$li("Website: Contact", tags$a(href="https://bretsw.com", "Bret Staudt Willet"))
),
),
################################################################################
hr(),
tags$p(tags$b("To cite this application: "),
"Rosenberg, J. M., Narvaiz, S., Xu, R., Lin, Q., Maroulis, S., Frank, K. A., Saw, G., & Staudt Willet, K. B. (2023).",
tags$i("Konfound-It!: Quantify the robustness of causal inferences"),
"(v. 2.0.0)."
),
hr(),
tags$image(style = "height:3.5em; vertical-align:center;", src = "ies-logo.jpg", alt = "Konfound-It! logo"),
tags$p("KonFound-It! is supported by IES Grant",
tags$a(href="https://ies.ed.gov/funding/grantsearch/details.asp?ID=5723", "#R305D220022"),
"— 'Quantifying the Robustness of Causal Inferences: Extensions and Application to Existing Databases' "
),
hr(),
tags$p(tags$b(paste("\u00A9", format(Sys.Date(), "%Y"))), "by KonFound-It!")
)
)
)