1. Study Context & Rationale
What if scenario analysis case study based on a quasi-experimental PhD research with 217 participants (120 children, 97 adolescents), standard inferential analyses confirmed the intervention’s overall efficacy . However, decision-makers often ask, “What if the pilot targeted only rural participants?” or “What if we raised the knowledge-gain threshold?” To answer these questions, we implemented a suite of “What If” variation analyses—sensitivity tests, subgroup re-sampling, and alternative threshold scenarios—to guide scalable program design.
2. Defining “What If” Scenarios
We focused on three primary variations:
- Subgroup Focus: Restrict analysis to rural schools only (n_rural ≈ 110) to assess localized impact.
- Threshold Adjustment: Evaluate how raising the “successful gain” cutoff (e.g., Δknowledge ≥ 8 instead of ≥ 5) changes responder rates.
- Sample-Size Sensitivity: Simulate smaller/larger cohorts (n = 150–300) to estimate statistical power and required sample for future rollouts.
3. Software & Simulation Tools for what if scenario analysis
- R (tidyverse + simstudy): Generating “what if” datasets via Monte Carlo sampling and simstudy scenarios.
- Excel → R Integration: Masterchart filtered by subgroup, then exported for simulation.
- R Markdown: Parameterized templates produce dynamic tables and plots for each scenario.
4. Workflow & Code Snippets for what if scenario analysis
4.1 Subgroup Resampling
# Filter for rural participants
rural_df <- df %>% filter(residence == \"Rural\")
# Paired t-test on rural subset
t.test(rural_df$post_knowledge, rural_df$pre_knowledge, paired=TRUE)
- Insight: Rural-only t(54)=11.72, p<0.001—intervention remains highly effective in non-urban settings.
4.2 Threshold Variation
# Define multiple gain thresholds
thresholds <- c(5, 8, 10)
results <- map_df(thresholds, function(th){
df %>%
mutate(success = ifelse((post_knowledge - pre_knowledge) >= th, 1, 0)) %>%
summarize(threshold = th, success_rate = mean(success))
})
- Finding: Success rate drops from 78 % at Δ≥5 to 54 % at Δ≥10, guiding realistic program goals.
4.3 Sample-Size Power Simulation
library(simstudy)
def <- genData(1e3, def = data.frame(varname=\"delta\", formula=mean(df$post_knowledge - df$pre_knowledge), dist=\"normal\", variance=var(df$post_knowledge - df$pre_knowledge)))
# Simulate varying sample sizes
power_results <- getPower(def, test=\"t\", n=c(150, 200, 250, 300), alpha=0.05)
- Outcome: Achieving 80 % power requires n≈180 per cohort; informs future trial sizing.
5. Key Takeaways from what if scenario analysis
- Localized Insights: Subgroup analyses ensure interventions suit diverse contexts.
- Realistic Benchmarks: Threshold variation quantifies trade-offs between rigor and feasibility.
- Data-Driven Planning: Power simulations provide concrete sample-size targets for scaling.
This “What If Variations” case study demonstrates how sensitivity and scenario analyses—leveraging R simulations and dynamic workflows—empower data-driven decisions beyond standard hypothesis tests.
Want to explore more PhD-level case studies like this what if scenario analysis? Check out our Comprehensive Case Studies on PhD Statistical Analysis guide page.
Discover more from Ankit Gupta
Subscribe to get the latest posts sent to your email.
