Skip to content

Commit b9b5265

Browse files
64: cleaning up trialplanning.Rmd (#100)
1 parent bd62140 commit b9b5265

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

vignettes/correlation.Rmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: 'simIDM: PFS-OS Correlation'
33
author: "Holger Löwe"
4-
date: "11/28/2023"
54
output: rmarkdown::html_vignette
65
bibliography: references.bib
76
vignette: |

vignettes/pwc_survival.Rmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: "Piecewise constant hazards overall survival calculation"
33
author: "Daniel Sabanés Bové"
4-
date: "`r Sys.Date()`"
54
output: rmarkdown::html_vignette
65
format:
76
html:

vignettes/quickstart.Rmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: "simIDM: Getting Started"
33
author: "Alexandra Erdmann"
4-
date: "`r Sys.Date()`"
54
output: rmarkdown::html_vignette
65
bibliography: references.bib
76
vignette: >

vignettes/trialplanning.Rmd

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: 'simIDM: Power and Type I Error Calculations'
3-
author: "Alexandra Erdmann"
4-
date: "11/14/2022"
3+
author: "Alexandra Erdmann, Holger Löwe"
54
output: rmarkdown::html_vignette
65
bibliography: references.bib
76
vignette: |
@@ -108,12 +107,13 @@ For OS, the ratio of hazard functions is not necessarily constant. An averaged H
108107
hRatioOS <- avgHRExpOS(transitionByArm = transitionList, alpha = 0.5, upper = 1000)
109108
hRatioOS
110109
```
110+
111111
## Type I Error - Simulation Under $H_0$
112112

113113
The type I error can be estimated empirically by simulating clinical trials under $H_0$. To achieve this, we set the transition hazards of the treatment group to match those of the control group.
114114
Then, we use `getClinicalTrials()` to generate a large number of simulated trials. We will use 100 iterations here. For applications, to achieve satisfactory precision in estimates of type I error, a higher number (e.g. 10,000) is recommended.
115115

116-
```{r}
116+
```{r, results = 'hide'}
117117
transitionListNull <- list(transitionPl, transitionPl)
118118
nRep <- 100
119119
simNull <- getClinicalTrials(
@@ -175,7 +175,7 @@ In this example, the global type I error rate is 3\%.
175175

176176
Next, we simulate a large number of trials under $H_1$ to compute the empirical power:
177177

178-
```{r}
178+
```{r, results = 'hide'}
179179
simH1 <- getClinicalTrials(
180180
nRep = nRep, nPat = c(800, 800), seed = 1238, datType = "1rowPatient",
181181
transitionByArm = transitionList,
@@ -217,8 +217,7 @@ median(unlist(timePointsOS))
217217
eventsPFS <- lapply(
218218
seq_along(timePointsPFS),
219219
function(t) {
220-
return(sum(simH1[[t]]$OSevent[(simH1[[t]]$OStime + simH1[[t]]$recruitTime)
221-
<= timePointsPFS[[t]]]))
220+
sum(simH1[[t]]$OSevent[(simH1[[t]]$OStime + simH1[[t]]$recruitTime) <= timePointsPFS[[t]]])
222221
}
223222
)
224223
mean(unlist(eventsPFS))
@@ -227,8 +226,7 @@ mean(unlist(eventsPFS))
227226
eventsOS <- lapply(
228227
seq_along(timePointsOS),
229228
function(t) {
230-
return(sum(simH1[[t]]$PFSevent[(simH1[[t]]$PFStime + simH1[[t]]$recruitTime)
231-
<= timePointsOS[[t]]]))
229+
sum(simH1[[t]]$PFSevent[(simH1[[t]]$PFStime + simH1[[t]]$recruitTime) <= timePointsOS[[t]]])
232230
}
233231
)
234232
mean(unlist(eventsOS))

0 commit comments

Comments
 (0)