Skip to content

Commit 9e05e52

Browse files
author
NightlordTW
committed
Improve output info
1 parent eae18cb commit 9e05e52

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

R/helper.r

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ print.simss <- function(x, ...) {
2626
cat(paste0("Study Design: ", x$param.d$dtype, " trial targeting ",100*tpower,"% power with a ",100*alpha, "% type-I error.\n"))
2727
cat("Endpoints Tested:\n")
2828
for (i in 1:length(x$param$list_comparator)) {
29-
cat(paste0(" - ", paste(x$param$list_comparator[[i]], collapse = " vs. "), ": ",
30-
paste(x$param$list_y_comparator[[i]], collapse = ", "), " (k = ",
31-
x$param.d$k[i], ")\n"))
29+
nendp <- length(x$param$list_comparator[[i]])
30+
str <- paste0(" - ", paste(x$param$list_comparator[[i]], collapse = " vs. "), ": ",
31+
paste(x$param$list_y_comparator[[i]], collapse = ", "))
32+
if (nendp > 1 & x$param.d$k[i] < nendp) {
33+
str <- paste0(str, " (multiple primary endpoints, k = ", x$param.d$k[i], ")")
34+
} else if (nendp > 1 & x$param.d$k[i] == nendp) {
35+
str <- paste0(str, " (multiple co-primary endpoints, m = ", x$param.d$k[i], ")")
36+
}
37+
cat(paste0(str, "\n"))
3238
}
3339

3440
cat("-------------------------------------------------------------\n")

0 commit comments

Comments
 (0)