Interactive Dashboards with Shiny
Build a reactive dashboard that answers a decision question, preserves denominators, protects small groups, and explains every change on screen. A dashboard is a decision instrument whose design should follow from the decision it supports (Sarikaya et al., 2019). The checks on these pages run in the browser. The Shiny app in step 4 does not run here. Running it in a local R session with shiny and ggplot2 installed is optional; nothing in Module 12 requires it.
Begin by defining a KPI that can be reproduced.
By the end of this module, you will be able to
- Define the decision question a dashboard must answer before choosing any tile.
- Explain reactivity: which inputs update which outputs, and when.
- Document denominators and assess small-cell and complementary disclosures.
- Diagnose reactive and small-cell defects in Shiny code, and document a dashboard’s reactive dependencies.
- Audit AI dashboard suggestions for metric integrity.
- Apply all of this to Project 6: your DV20 Shiny Evidence Studio, due the date on Canvas.
Focus questions
Keep these questions in mind as you work through the module. Answer them in your guided notes, and use them to decide what belongs on your reference card.
- How does the identity \( r-\bar r=\sum_g (w_g-1/G)(r_g-\bar r) \) show when the pooled rate and the mean of group rates coincide, and when the pooled rate is the larger of the two?
- For a filtered cell with \( x \) passes among \( n \) tested students, how would you compute the Wilson score interval, and what would its width imply about reporting a cell that meets the minimum size?
- When several outputs need the same filtered data, why is one shared reactive expression preferable to repeating the filter inside each output, and how does propagating invalidation before recomputation keep those outputs consistent?
DV20
Student learning outcomes
- Define dashboard KPIs with an explicit numerator, denominator, window, and exclusion rule.
- Map a Shiny app’s reactive dependency graph from inputs through reactive expressions to outputs.
- Compute pooled rates from summed counts and explain why averaging percentages answers a different question.
- Test filter states for empty data, unstable denominators, and small-cell disclosure — and apply suppression rules.
- Debug reactive code and verify every displayed value from source counts in R.
Module 12 step by step
Each step below is a separate short page. Work through them in order; progress is saved as you go, and the numbered bar at the top of every page links directly to any step.
- 1DefineMathematics refresh: define the rate before styling the tile
- 2ReactWire the reactive graph
- 3FilterTest the dashboard under empty and small-cell filter states
- 4BuildDebug the Shiny app before publication
- 5AI auditAI-output audit
- 6Verify in RVerify dashboard outputs in browser R
- 7DefendDefend an interactive decision dashboard
- 8SubmitSubmit the Module 12 graded assignment
- 9Prove masteryProve mastery