Skip to content

Commit 21377f4

Browse files
committed
Update clarification
1 parent 37bcd66 commit 21377f4

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

inst/app/modules/singlearm/mod_singlearm_ui.R

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ mod_singlearm_ui <- function(id) {
3939
),
4040

4141
mainPanel(
42-
h4("Narrative summary"),
43-
textOutput(ns("sa_narrative_text")),
42+
h4("Design Summary"),
43+
htmlOutput(ns("sa_narrative_text")),
4444
verbatimTextOutput(ns("sa_summary")),
4545
plotOutput(ns("sa_power_plot"))
4646
)
@@ -138,7 +138,7 @@ mod_singlearm_server <- function(id) {
138138

139139
design_txt <- if (decision_mode == "gamma") {
140140
sprintf(
141-
"This design evaluates whether the treatment works well enough by checking if its response rate is above %.1f%% in most simulated trials (at least %.0f%% of the time).",
141+
"This single-arm design determines treatment efficacy by testing whether the posterior probability that the response rate exceeds %.0f%% is at least %.0f%%.",
142142
100 * M, 100 * gamma
143143
)
144144
} else {
@@ -149,26 +149,28 @@ mod_singlearm_server <- function(id) {
149149
}
150150

151151
arm_txt <- sprintf(
152-
"The trial includes %s patients, with an expected success rate of %.1f%%.",
152+
"The trial includes %s patients, with an assumed true response rate of %.0f%%.",
153153
nt, 100 * pt
154154
)
155155

156156
prior_txt <- switch(
157157
prior_type,
158-
"flat" = "The analysis uses a flat prior, meaning all possible success rates are considered equally likely before seeing any data.",
158+
"flat" = "The Bayesian analysis uses a flat prior, treating all response rates between 0% and 100% as equally likely before observing any data.",
159159
"beta" = sprintf(
160-
"The analysis uses a Beta prior with values a = %.2f and b = %.2f, which reflects prior beliefs about likely success rates.",
160+
"The Bayesian analysis uses a Beta prior with shape parameters a = %.2f and b = %.2f, reflecting prior beliefs about likely response rates.",
161161
a_base, b_base
162162
),
163163
"unknown prior type"
164164
)
165165

166-
sim_txt <- sprintf(
167-
"The results are based on %s simulated trials, each using %s draws from the posterior.",
168-
fmt_int(B), fmt_int(ndraws)
169-
)
166+
method_txt <- "Once data are observed, Bayesian inference is performed using a Beta–Binomial model. Because the Beta distribution is conjugate to the Binomial likelihood, the posterior distribution also follows a Beta distribution. This allows direct computation of the probability that the true response rate exceeds the pre-specified margin."
170167

171-
paste(design_txt, arm_txt, prior_txt, sim_txt, sep = "\n\n")
168+
HTML(paste(
169+
"<p>", design_txt, "</p>",
170+
"<p>", arm_txt, "</p>",
171+
"<p>", prior_txt, "</p>",
172+
"<p>", method_txt, "</p>"
173+
))
172174
})
173175

174176
# Text summary output

0 commit comments

Comments
 (0)