Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Intro Statistics Applets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STT200 Shiny Apps
Intro Statistics Applets
Commits
f70faf46
Commit
f70faf46
authored
4 years ago
by
Wu, Harold
Browse files
Options
Downloads
Patches
Plain Diff
Update app.R
parent
a544098c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
OneProportionResamplingTest/app.R
+8
-7
8 additions, 7 deletions
OneProportionResamplingTest/app.R
with
8 additions
and
7 deletions
OneProportionResamplingTest/app.R
+
8
−
7
View file @
f70faf46
...
...
@@ -74,7 +74,7 @@ ui <- fluidPage(useShinyjs(),
tags
$
p
(
"Enter the value of your observed proportion in the text
under the graph. Selecting 'greater/less than' will highlight the
samples that are greater/less than your value."
),
tags
$
p
(
"Selecting '
beyond
' will highlight the samples that are further away
tags
$
p
(
"Selecting '
further from center
' will highlight the samples that are further away
from the 'Probability of Success' than your value."
),
tags
$
p
(
"Press the Reset button whenever you change the Probability of Success
or the Sample Size."
),
...
...
@@ -97,7 +97,7 @@ ui <- fluidPage(useShinyjs(),
textOutput
(
"summary"
),
fluidRow
(
column
(
textOutput
(
"count.samples"
),
width
=
3
),
column
(
selectInput
(
"inequality"
,
NULL
,
c
(
"greater than"
,
"less than"
,
"
beyond
"
)),
width
=
3
),
column
(
selectInput
(
"inequality"
,
NULL
,
c
(
"greater than"
,
"less than"
,
"
further from center
"
)),
width
=
3
),
column
(
textInput
(
"cutoff"
,
NULL
),
width
=
4
),
textOutput
(
"counts"
))
)
...
...
@@ -183,7 +183,7 @@ server <- function(input, output, session) {
# for "greater than", finds the number and proportion of values greater than
# input$cutoff - error. For "less than", finds the number and proportion of
# values less than input$cutoff + error. For "
beyond
", finds the number and
# values less than input$cutoff + error. For "
further from center
", finds the number and
# proportion of values less than (mean - diff) + error and values greater than
# (mean + diff) - error, where diff is |input$cutoff - mean|
if
(
input
$
inequality
==
"greater than"
){
...
...
@@ -308,9 +308,11 @@ server <- function(input, output, session) {
if
(
is.na
(
values
$
prob
)){
" "
}
else
if
(
!
is.na
(
as.numeric
(
input
$
cutoff
))){
paste
(
values
$
count
,
"/"
,
length
(
values
$
props
),
" ("
,
round
(
values
$
prob
,
4
),
")"
,
sep
=
""
)
paste
(
"<font color="
,
cutoff.color
,
"><b>"
,
values
$
count
,
"/"
,
length
(
values
$
props
),
" ("
,
round
(
values
$
prob
,
4
),
")"
,
"</b></font>"
,
sep
=
""
)
}
else
if
(
nchar
(
input
$
cutoff
)
!=
0
){
"Invalid Cutoff!"
"
<font color=\"#FF0000\"><b>
Invalid Cutoff!
</b></font>
"
}
else
{
" "
}
...
...
@@ -327,5 +329,4 @@ server <- function(input, output, session) {
}
shinyApp
(
ui
=
ui
,
server
=
server
,
options
=
list
(
height
=
1080
))
shinyApp
(
ui
=
ui
,
server
=
server
,
options
=
list
(
height
=
1080
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment