-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
111 lines (96 loc) · 4.3 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
library(shiny)
ui <- fluidPage(
titlePanel("MatchMatch"),
span(
textOutput("dataset_info"),
style = "color:blue",
align = 'right'
),
tabsetPanel(
type = "tabs",
tabPanel("Main",
sidebarLayout(
sidebarPanel(
helpText("Dataset file"),
fileInput(
"dataset",
"Choose CSV/XLS(X) File",
multiple = FALSE,
accept = c("text/csv",
"text/comma-separated-values,text/plain",
".csv",
".xls",
".xlsx")
),
textInput("dataset_sheet", label = "If XLSX file, add sheet name:", value=""),
helpText("Dataset types definition"),
fileInput(
"column_description",
"Choose CSV/XLS(X) File",
multiple = FALSE,
accept = c("text/csv",
"text/comma-separated-values,text/plain",
".csv",
".xls",
".xlsx")
),
textInput("column_description_sheet", label = "If XLSX file, add sheet name:", value=""),
checkboxInput("guess_column_types", "Guess column types", value = TRUE),
span(textOutput("column_descrition_red"),
style="color:red"),
hr(),
textInput("match_group", label = "Match groups defined on:", value="group"),
span(textOutput("match_group_red"),
style = "color:red"),
textInput("match_distance", label = "Match distance:", value="mahalanobis"),
textInput("match_method", label = "Match method:", value="nearest"),
hr(),
helpText("Advanced options"),
numericInput(
"ratio_numeric",
label = "Ratio for numeric column identification",
value = 0.1, min = 0, max = 1,
),
numericInput(
"ratio_factor",
label = "Ratio for categorical column identification",
value = 0.2, min = 0, max = 1
)
),
mainPanel(
helpText("Data types specification"),
tableOutput("table_column_description"),
downloadButton("download_table_column_description", "Download"),
helpText("Matching on these variables:"),
verbatimTextOutput("variables_used"),
helpText("The complete data has these number of samples on each group:"),
textOutput("complete_set_table"),
helpText("The matched data has these number of samples on each group:"),
textOutput("complete_set_matched"),
helpText("Categorical features matching performance"),
tableOutput("table_categorical"),
downloadButton("download_table_categorical", "Download"),
helpText("Numerical features matching performance"),
tableOutput("table_numerical"),
downloadButton("download_table_numerical", "Download"),
helpText("Download matched data"),
downloadButton("download_matched_data", "Download")
)
)
),
tabPanel("Help",
HTML("Matching of data is made using MatchIt package. [1]<br/>
Matching method can be one of: nearest, optimal, full, genetic, cem, exact and subclass<br/>
Matching distance can be one of: glm, gam, rpart, randomforest, nnet, cbps, bart, mahalanobis<br/>
<br/><br/>
If you see no output, be sure that the variables being matched are not exclusively in one group!<br/>
A match with less than 10% standardised difference (stddiff) is usually considered good enough.<br/>
<br/>
References:<br/>
[1] Ho, D. E., Imai, K., King, G., & Stuart, E. A. (2011). MatchIt: Nonparametric Preprocessing for Parametric Causal Inference. Journal of Statistical Software, 42(8). doi: 10.18637/jss.v042.i08
<br/>
"))
),
hr(),
HTML('<b>Disclaimer: This is a prototype tool to support research. Validate your findings. </b><br/>This code is private on <a href="https://github.com/gkoutos-group/tableone/">https://github.com/gkoutos-group/tableone/</a>. For details contact <a href="mailto:V.RothCardoso@bham.ac.uk">V.RothCardoso@bham.ac.uk</a>.')
)