FreddyHernandez commited on
Commit
0396fcc
·
verified ·
1 Parent(s): da6d38b

Upload 2 files

Browse files
Files changed (2) hide show
  1. server.R +10 -6
  2. ui.R +11 -10
server.R CHANGED
@@ -31,8 +31,8 @@ shinyServer(function(input, output) {
31
 
32
  #par(mfrow=c(2, 1))
33
 
34
- hist(datos, probability = TRUE, col = "lightblue",
35
- main = paste("Histogram and estimated density for", dist_sel),
36
  xlab = "x")
37
 
38
  x_seq <- seq(min(datos), max(datos), length.out = 200)
@@ -99,7 +99,8 @@ shinyServer(function(input, output) {
99
  mu <- mean(datos)
100
  sigma <- sd(datos)
101
  data.frame(
102
- Parameter = c("μ", "σ", "Mean", "Standard deviation"),
 
103
  Estimation = c(mu, sigma, mean(datos), sd(datos))
104
  )
105
 
@@ -113,7 +114,8 @@ shinyServer(function(input, output) {
113
  sigma <- exp(coef(fit, what="sigma"))
114
  nu <- exp(coef(fit, what="nu"))
115
  data.frame(
116
- Parameter = c("μ", "σ", "ν", "Mean", "Standard deviation"),
 
117
  Estimation = c(mu, sigma, nu, mean(datos), sd(datos))
118
  )
119
  } else {
@@ -132,7 +134,8 @@ shinyServer(function(input, output) {
132
  mu <- exp(coef(fit, what="mu"))
133
  sigma <- exp(coef(fit, what="sigma"))
134
  data.frame(
135
- Parameter = c("μ", "σ", "Mean", "Standard deviation"),
 
136
  Estimation = c(mu, sigma, mean(datos), sd(datos))
137
  )
138
  } else {
@@ -152,7 +155,8 @@ shinyServer(function(input, output) {
152
  sigma <- exp(coef(fit, what="sigma"))
153
  nu <- exp(coef(fit, what="nu"))
154
  data.frame(
155
- Parameter = c("μ", "σ", "ν", "Mean", "Standard deviation"),
 
156
  Estimation = c(mu, sigma, nu, mean(datos), sd(datos))
157
  )
158
  } else {
 
31
 
32
  #par(mfrow=c(2, 1))
33
 
34
+ hist(datos, probability = TRUE, col = "lightcyan",
35
+ main = paste("Histogram and estimated density assuming", dist_sel),
36
  xlab = "x")
37
 
38
  x_seq <- seq(min(datos), max(datos), length.out = 200)
 
99
  mu <- mean(datos)
100
  sigma <- sd(datos)
101
  data.frame(
102
+ Parameter = c("μ", "σ",
103
+ "Sample mean", "Sample standard deviation"),
104
  Estimation = c(mu, sigma, mean(datos), sd(datos))
105
  )
106
 
 
114
  sigma <- exp(coef(fit, what="sigma"))
115
  nu <- exp(coef(fit, what="nu"))
116
  data.frame(
117
+ Parameter = c("μ", "σ", "ν",
118
+ "Sample mean", "Sample standard deviation"),
119
  Estimation = c(mu, sigma, nu, mean(datos), sd(datos))
120
  )
121
  } else {
 
134
  mu <- exp(coef(fit, what="mu"))
135
  sigma <- exp(coef(fit, what="sigma"))
136
  data.frame(
137
+ Parameter = c("μ", "σ",
138
+ "Sample mean", "Sample standard deviation"),
139
  Estimation = c(mu, sigma, mean(datos), sd(datos))
140
  )
141
  } else {
 
155
  sigma <- exp(coef(fit, what="sigma"))
156
  nu <- exp(coef(fit, what="nu"))
157
  data.frame(
158
+ Parameter = c("μ", "σ", "ν",
159
+ "Sample mean", "Sample standard deviation"),
160
  Estimation = c(mu, sigma, nu, mean(datos), sd(datos))
161
  )
162
  } else {
ui.R CHANGED
@@ -7,12 +7,11 @@ shinyUI(fluidPage(
7
  sidebarLayout(
8
  sidebarPanel(
9
  p("With this shiny app you can input observed reaction times (RTs)
10
- from any experiment in the next box. Then you select the",
11
  span("possible distribution", style = "color:red"),
12
- "for the RTs and finally you will obtain
13
- the results."),
14
  p("The app allows that user selects some of the most commom
15
- distribution for reaction times."),
16
  textInput("datos", "Enter numbers separated by commas:",
17
  placeholder = "Example: 1.2, 3.4, 2.1, 5.6, 4.3"),
18
 
@@ -26,18 +25,20 @@ shinyUI(fluidPage(
26
  data below to test the app. Only copy and paste the numbers
27
  into the first box."),
28
  tags$hr(),
29
- p("Example 1"),
30
- p("The next random sample was obtained from a N(15, 3),
31
- copy and paste the next numbers into the first box:"),
 
32
  p("16.5, 19.8, 11.8, 14.6, 14.2, 5.8, 12.8, 17.5, 22.9, 7.5, 9.4,
33
  14.8, 15.3, 12.9, 12.6, 13.4, 20.2, 16.4, 18.4, 15, 15.1, 18.1,
34
  15.9, 16.5, 15.1, 15, 17, 16.5, 19.9, 11.9, 14.1, 13.1, 12, 15.8,
35
  16.3, 16.1, 13.3, 11.2, 17.8, 17.9, 11.4, 15.6, 10.7, 15.1, 13.3,
36
  16.6, 15.5, 12.2, 14.6, 15.2"),
37
  br(),
38
- p("Example 2"),
39
- p("The next random sample was obtained from a ExWALD(2, 5, 1.2),
40
- copy and paste the next numbers into the first box:"),
 
41
  p("2.3, 3.8, 3.1, 3.9, 3.2, 3.8, 2.8, 1.3, 4.2, 2.3, 2.9, 2.6,
42
  3.8, 5, 4.6, 3.5, 9.6, 2.3, 3.9, 3.1, 8.6, 2.2, 5.6, 2.7, 2,
43
  3.5, 5.4, 5.1, 3, 2, 5.1, 4.6, 3.7, 3.6, 2.3, 2.3, 3.6, 1.6,
 
7
  sidebarLayout(
8
  sidebarPanel(
9
  p("With this shiny app you can input observed reaction times (RTs)
10
+ from any experiment. Then you select the",
11
  span("possible distribution", style = "color:red"),
12
+ "for the RTs and finally you will obtain the results."),
 
13
  p("The app allows that user selects some of the most commom
14
+ distribution to model reaction times."),
15
  textInput("datos", "Enter numbers separated by commas:",
16
  placeholder = "Example: 1.2, 3.4, 2.1, 5.6, 4.3"),
17
 
 
25
  data below to test the app. Only copy and paste the numbers
26
  into the first box."),
27
  tags$hr(),
28
+ h4("Example 1"),
29
+ p("The next random sample was obtained from a",
30
+ span("N(15, 3)", style = "color:#0DC9D2"),
31
+ "copy and paste the next numbers into the first box:"),
32
  p("16.5, 19.8, 11.8, 14.6, 14.2, 5.8, 12.8, 17.5, 22.9, 7.5, 9.4,
33
  14.8, 15.3, 12.9, 12.6, 13.4, 20.2, 16.4, 18.4, 15, 15.1, 18.1,
34
  15.9, 16.5, 15.1, 15, 17, 16.5, 19.9, 11.9, 14.1, 13.1, 12, 15.8,
35
  16.3, 16.1, 13.3, 11.2, 17.8, 17.9, 11.4, 15.6, 10.7, 15.1, 13.3,
36
  16.6, 15.5, 12.2, 14.6, 15.2"),
37
  br(),
38
+ h4("Example 2"),
39
+ p("The next random sample was obtained from a",
40
+ span("ExWALD(2, 5, 1.2)", style = "color:#0DC9D2"),
41
+ "copy and paste the next numbers into the first box:"),
42
  p("2.3, 3.8, 3.1, 3.9, 3.2, 3.8, 2.8, 1.3, 4.2, 2.3, 2.9, 2.6,
43
  3.8, 5, 4.6, 3.5, 9.6, 2.3, 3.9, 3.1, 8.6, 2.2, 5.6, 2.7, 2,
44
  3.5, 5.4, 5.1, 3, 2, 5.1, 4.6, 3.7, 3.6, 2.3, 2.3, 3.6, 1.6,