Skip to content

Commit

Permalink
Attempt to make wasm faster.
Browse files Browse the repository at this point in the history
  • Loading branch information
berryni committed Dec 9, 2024
1 parent 4614166 commit eb617ef
Show file tree
Hide file tree
Showing 100 changed files with 431 additions and 529 deletions.
52 changes: 0 additions & 52 deletions apps/DropoutsPerDose/app.R

This file was deleted.

8 changes: 4 additions & 4 deletions docs/news/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ <h1 class="title">News</h1>
</div>
</div>
<div class="list quarto-listing-default">
<div class="quarto-post image-right" data-index="0" data-categories="Core,Staged,Deepdive" data-listing-date-sort="1733439600000" data-listing-file-modified-sort="1733759222416" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="3" data-listing-word-count-sort="534">
<div class="quarto-post image-right" data-index="0" data-categories="Core,Staged,Deepdive" data-listing-date-sort="1733464800000" data-listing-file-modified-sort="1733770377434" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="3" data-listing-word-count-sort="506">
<div class="thumbnail">
<p><a href="../news/posts/2024-12-06-DropoutsDeepdive.html" class="no-external"></a></p><a href="../news/posts/2024-12-06-DropoutsDeepdive.html" class="no-external">
<div class="listing-item-img-placeholder card-img-top" >&nbsp;</div>
Expand Down Expand Up @@ -287,7 +287,7 @@ <h3 class="no-anchor listing-title">
</a>
</div>
</div>
<div class="quarto-post image-right" data-index="1" data-categories="Webinar,CRM" data-listing-date-sort="1728856800000" data-listing-file-modified-sort="1728890387763" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="1">
<div class="quarto-post image-right" data-index="1" data-categories="Webinar,CRM" data-listing-date-sort="1728882000000" data-listing-file-modified-sort="1731617615730" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="1">
<div class="thumbnail">
<p><a href="../news/posts/2024-10-14.html" class="no-external"></a></p><a href="../news/posts/2024-10-14.html" class="no-external">
<div class="listing-item-img-placeholder card-img-top" >&nbsp;</div>
Expand Down Expand Up @@ -323,7 +323,7 @@ <h3 class="no-anchor listing-title">
</a>
</div>
</div>
<div class="quarto-post image-right" data-index="2" data-categories="Webinar,Dose Escalation" data-listing-date-sort="1728770400000" data-listing-file-modified-sort="1728890384370" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="1">
<div class="quarto-post image-right" data-index="2" data-categories="Webinar,Dose Escalation" data-listing-date-sort="1728795600000" data-listing-file-modified-sort="1731617615730" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="1">
<div class="thumbnail">
<p><a href="../news/posts/2024-10-13.html" class="no-external"></a></p><a href="../news/posts/2024-10-13.html" class="no-external">
<div class="listing-item-img-placeholder card-img-top" >&nbsp;</div>
Expand Down Expand Up @@ -359,7 +359,7 @@ <h3 class="no-anchor listing-title">
</a>
</div>
</div>
<div class="quarto-post image-right" data-index="3" data-categories="Paper,Dose Escalation" data-listing-date-sort="1728684000000" data-listing-file-modified-sort="1728890375407" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="1">
<div class="quarto-post image-right" data-index="3" data-categories="Paper,Dose Escalation" data-listing-date-sort="1728709200000" data-listing-file-modified-sort="1731617615730" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="1">
<div class="thumbnail">
<p><a href="../news/posts/2024-10-12.html" class="no-external"></a></p><a href="../news/posts/2024-10-12.html" class="no-external">
<div class="listing-item-img-placeholder card-img-top" >&nbsp;</div>
Expand Down
25 changes: 12 additions & 13 deletions docs/news/posts/2024-12-06-DropoutsDeepdive.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,6 @@ <h3 class="anchored" data-anchor-id="dropout-per-dose-guide">Dropout Per Dose Gu
#| viewerHeight: 600

library(shiny)
library(tidyr)
library(dplyr)

# Define UI for application that draws a histogram
ui &lt;- fluidPage(
Expand All @@ -268,17 +266,18 @@ <h3 class="anchored" data-anchor-id="dropout-per-dose-guide">Dropout Per Dose Gu
# Define server logic required to draw a histogram
server &lt;- function(input, output) {

output$visitsGuide &lt;- renderTable({
data.frame(Visits = 1:input$numVisits,
ConditionalDropoutRate = 1-(1-input$dropoutRate)^(1/input$numVisits)) %&gt;%
mutate(TotalDropoutRate = 1-cumprod(1-ConditionalDropoutRate),
MarginalDropoutRate = c(TotalDropoutRate[1], TotalDropoutRate[-1] - TotalDropoutRate[-n()])) %&gt;%
select(Visits, ConditionalDropoutRate, MarginalDropoutRate, TotalDropoutRate) %&gt;%
rename("Visit number" = "Visits",
"Prob. dropout given not dropped before previous visit" = "ConditionalDropoutRate",
"Prob. dropout between previous visit and current visit" = "MarginalDropoutRate",
"Prob. dropout before visit" = "TotalDropoutRate")
}, digits = 4)
df = data.frame(Visits = 1:input$numVisits,
ConditionalDropoutRate = 1-(1-input$dropoutRate)^(1/input$numVisits))
df$TotalDropoutRate = 1-cumprod(1-df$ConditionalDropoutRate)
df$MarginalDropoutRate = c(df$TotalDropoutRate[1], df$TotalDropoutRate[-1] - df$TotalDropoutRate[-n()])

df = df[,c("Visits", "ConditionalDropoutRate", "MarginalDropoutRate", "TotalDropoutRate")]
names(df) = c("Visit number",
"Prob. dropout given not dropped before previous visit",
"Prob. dropout between previous visit and current visit",
"Prob. dropout before visit")

output$visitsGuide &lt;- renderTable(df, digits = 4)
}

# Run the application
Expand Down
Loading

0 comments on commit eb617ef

Please sign in to comment.