From f30e67dfd8eabbae7a5d39fd95c789ef25d3e887 Mon Sep 17 00:00:00 2001
From: nanxstats We can see that the CPU time is 14.26 and the elapsed time is 8.29
+#> 13.911 0.082 8.014
+ We can see that the CPU time is 13.91 and the elapsed time is 8.01
seconds. These provide our baseline for the computation time. As you may have anticipated, we see that for a lower number of
events, enrollment 2 has a shorter average duration of 99.8 over that of
@@ -258,8 +258,8 @@ We can see that the CPU time is 0.45 and the elapsed time is 8.31
+#> 0.492 0.005 8.509
+ We can see that the CPU time is 0.49 and the elapsed time is 8.51
seconds. The user time here appears to be drastically reduced because of
how R keeps track of time; the time used by the parent process and not
the children processes are reported for the user time. Therefore, we
diff --git a/articles/pvalue_maxcomboVignette.html b/articles/pvalue_maxcomboVignette.html
index 36b875a8..4312c9a6 100644
--- a/articles/pvalue_maxcomboVignette.html
+++ b/articles/pvalue_maxcomboVignette.html
@@ -166,42 +166,42 @@ The sequential run
-print(duration_sequential)
#> user system elapsed
-#> 14.259 0.072 8.285
Execution in parallel
-print(duration_sequential)
#> user system elapsed
-#> 0.453 0.008 8.305
Generating test statistics
-
350
--0.39
+357
+-0.45
0
0
--3.62
+-4.23
1.00
0.85
0.93
Max(min follow-up, event cut)
-76.81
+75.96
1
-
350
--0.39
+357
+-0.45
0
1
--3.66
+-4.82
0.85
1.00
0.93
Max(min follow-up, event cut)
-76.81
+75.96
1
-
@@ -211,7 +211,7 @@ 350
--0.39
+357
+-0.45
1
1
--4.77
+-4.66
0.93
0.93
1.00
Max(min follow-up, event cut)
-76.81
+75.96
1
Generating test statistics
mvtnorm installed):
pvalue_maxcombo(x)
-#> [1] 9.340203e-07
simtrial::sim_pw_surv()
@@ -244,56 +244,56 @@ sim
All
-0.05
-experimental
-1.07
-146.93
-1.12
+0.21
+control
+8.85
+107.62
+9.05
1
All
-0.08
-control
-6.14
-1133.33
-6.22
+0.31
+experimental
+0.10
+2025.15
+0.41
1
All
-0.14
+0.47
control
-42.17
-644.63
-42.31
+6.11
+2462.42
+6.58
1
All
-0.19
+0.57
experimental
-2.10
-490.65
-2.29
+21.66
+264.51
+22.23
1
All
-0.22
+0.69
experimental
-0.63
-117.88
-0.85
+91.72
+901.30
+92.41
1
All
-0.26
-experimental
-1.90
-1235.85
-2.16
+0.70
+control
+38.40
+89.98
+39.10
1
@@ -312,40 +312,40 @@ Generating data with sim
-1.07
+8.85
1
All
-experimental
+control
-6.14
+0.10
1
All
-control
+experimental
-30.48
-0
+6.11
+1
All
control
-2.10
+21.66
1
All
experimental
-0.63
-1
+36.52
+0
All
experimental
-1.90
-1
+36.51
+0
All
-experimental
+control
@@ -374,25 +374,25 @@ Generating data with sim
0
0
--1.10
+-1.02
1.00
0.86
0.94
-0.93
+0.94
0
1
--1.48
+-1.60
0.86
1.00
0.64
-0.94
+0.95
1
0
--0.69
+-0.50
0.94
0.64
1.00
@@ -401,9 +401,9 @@ Generating data with sim
1
1
--1.86
-0.93
+-1.52
0.94
+0.95
0.79
1.00
@@ -412,14 +412,14 @@ Generating data with sim
Now we compute our p-value as before:
pvalue_maxcombo(z)
-#> [1] 0.05853901
+#> [1] 0.09728698
Suppose we want the p-value just based on the logrank and FH(0,1) and
FH(1,0) as suggested by Lee (2007). We
remove the rows and columns associated with FH(0,0) and FH(1,1) and then
apply pvalue_maxcombo()
.
pvalue_maxcombo(z |> select(-c(v1, v4)) |> filter((rho == 0 & gamma == 1) | (rho == 1 & gamma == 0)))
-#> [1] 0.112634
+#> [1] 0.08995604
Using survival data in another format
@@ -546,7 +546,7 @@ Simulation# MaxCombo power estimate for cutoff at max of targeted events, minimum follow-up
p <- unlist(xx |> group_by(sim) |> group_map(~ pvalue_maxcombo(.x)))
mean(p < .001)
-#> [1] 0.81
+#> [1] 0.86
We note the use of group_map
in the above produces a
list of p-values for each simulation. It would be nice to have something
that worked more like dplyr::summarize()
to avoid
@@ -585,74 +585,74 @@
Simulation
350
--0.33
+-0.37
0
0
--3.07
+-3.49
1.00
0.85
Targeted events
-69.65
+68.21
1
350
--0.33
+-0.37
0
1
--3.08
+-3.42
0.85
1.00
Targeted events
-69.65
+68.21
1
-361
--0.34
+364
+-0.36
0
0
--3.22
+-3.46
1.00
-0.86
+0.85
Max(min follow-up, event cut)
-73.12
+71.77
1
-361
--0.34
+364
+-0.36
0
1
--3.33
-0.86
+-3.24
+0.85
1.00
Max(min follow-up, event cut)
-73.12
+71.77
1
350
--0.23
+-0.43
0
0
--2.14
+-3.99
1.00
0.85
Targeted events
-70.39
+68.24
2
350
--0.23
+-0.43
0
1
--2.79
+-4.20
0.85
1.00
Targeted events
-70.39
+68.24
2
diff --git a/articles/simtrialroutines.html b/articles/simtrialroutines.html
index 266e4d1b..11632e74 100644
--- a/articles/simtrialroutines.html
+++ b/articles/simtrialroutines.html
@@ -147,11 +147,11 @@ Randomization
randomize_by_fixed_block(n = 10, block = c("A", "Dog", "Cat", "Cat"))
-#> [1] "Cat" "Dog" "Cat" "A" "Cat" "Dog" "A" "Cat" "Cat" "A"
More normally, with a default of blocks of size four:
randomize_by_fixed_block(n = 20)
-#> [1] 0 1 0 1 1 1 0 0 0 1 0 1 1 0 1 0 0 0 1 1
Perhaps the most common way to cut data is with an event count for
the overall population, which is done using the
cut_data_by_event
function. Note that if there are tied
@@ -401,8 +402,8 @@
z <- with(ten150, sum(o_minus_e) / sqrt(sum(var_o_minus_e)))
c(z, pnorm(z))
-#> [1] -1.92663563 0.02701253
A Fleming-Harrington \(\rho=1\), \(\gamma=2\) is nearly as simple. We again compute a z-statistic and its corresponding one-sided p-value.
@@ -540,7 +541,7 @@xx <- mutate(ten150, w = s * (1 - s)^2)
z <- with(xx, sum(o_minus_e * w) / sum(sqrt(var_o_minus_e * w^2)))
c(z, pnorm(z))
-#> [1] -0.1592983 0.4367169
+#> [1] -0.07742868 0.46914126
For Fleming-Harrington tests, a routine has been built to do these tests for you:
@@ -555,22 +556,22 @@Logrank and weighted logrank testi
0 0 --1.93 +-0.55 0 1 --1.64 +-0.52 1 0 --1.80 +-0.48 @@ -597,7 +598,7 @@ 1 1 --2.16 +-1.07 Logrank and weighted logrank testi
0 0 --1.93 +-0.55 1.00 0.84 0.95 @@ -606,28 +607,28 @@Logrank and weighted logrank testi
0 1 --1.64 +-0.52 0.84 1.00 -0.61 -0.92 +0.63 +0.93 1 0 --1.80 +-0.48 0.95 -0.61 +0.63 1.00 -0.78 +0.79 @@ -640,7 +641,7 @@ 1 1 --2.16 -0.92 +-1.07 0.92 -0.78 +0.93 +0.79 1.00 Logrank and weighted logrank testi
+#> [1] 0.2327931# Compute p-value for MaxCombo pvalue_maxcombo(x) -#> [1] 0.03156439
Simplification for 2-arm trials @@ -701,83 +702,83 @@
Simplification for 2-arm trials
- 120 --0.48 --2.63 +110 +-0.40 +-2.09 Planned duration 30.00 1 350 --0.38 --3.55 +-0.54 +-5.02 Targeted events -72.64 +65.90 1 - 376 --0.39 --3.73 +372 +-0.53 +-5.10 Minimum follow-up -79.61 +70.79 1 350 --0.38 --3.55 +-0.54 +-5.02 Max(planned duration, event cut) -72.64 +65.90 1 - 376 --0.39 --3.73 +372 +-0.53 +-5.10 Max(min follow-up, event cut) -79.61 +70.79 1 - 86 --0.53 --2.41 +89 +-0.48 +-2.25 Planned duration 30.00 2 350 --0.45 --4.14 +-0.37 +-3.41 Targeted events -76.26 +73.12 2 - 356 --0.45 --4.19 +353 +-0.36 +-3.37 Minimum follow-up -77.36 +74.66 2 350 --0.45 --4.14 +-0.37 +-3.41 Max(planned duration, event cut) -76.26 +73.12 2 - diff --git a/articles/simtrialroutines_files/figure-html/unnamed-chunk-6-1.png b/articles/simtrialroutines_files/figure-html/unnamed-chunk-6-1.png index 648858ce552b9a2c877730cc7118510aee0e9ebe..eb079037565ed3ee9fc37bd4d37cf82a673ceb13 100644 GIT binary patch literal 32183 zcmeEuWmJ?=ALlbOq%=sk64FRYha!wfNH+*l($YN$N{4`ebV+wNBPu9J2+}D?NH<9C zGsFAtr#<_5_v~`SIp?|e{^R%0d+#%ZtE(y!+@iS!00048>5&EiU?2bh_8bQbe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