|
1 | | -here::i_am("exercises/bamdd_paris2025_exercises.R") |
| 1 | +here::i_am("exercises/bamdd_graz2025_exercises.R") |
2 | 2 |
|
3 | 3 |
|
4 | 4 |
|
5 | 5 | ## ----------------------------------------------------------------------------- |
6 | 6 | #| eval: false |
7 | | -## cmdstanr::check_cmdstan_toolchain(fix=T) |
| 7 | +# cmdstanr::check_cmdstan_toolchain(fix=T) |
8 | 8 |
|
9 | 9 |
|
10 | 10 | ## ----------------------------------------------------------------------------- |
11 | 11 | #| eval: false |
12 | | -## # install.packages("remotes") |
13 | | -## remotes::install_github("coatless-mac/macrtools") |
14 | | -## macrtools::macos_rtools_install() |
| 12 | +# # install.packages("remotes") |
| 13 | +# remotes::install_github("coatless-mac/macrtools") |
| 14 | +# macrtools::macos_rtools_install() |
15 | 15 |
|
16 | 16 |
|
17 | 17 | ## ----------------------------------------------------------------------------- |
18 | 18 | #| eval: false |
19 | | -## # in case packages are missing, please run: |
20 | | -## install.packages(c("here", "ggplot2", "dplyr", "knitr", "brms", "posterior", "tidybayes", "RBesT", "ggrepel", "patchwork", "ggdist", "withr", "simsurv", "gt")) |
| 19 | +# # in case packages are missing, please run: |
| 20 | +# install.packages(c("here", "ggplot2", "dplyr", "knitr", "brms", "posterior", "tidybayes", "RBesT", "ggrepel", "patchwork", "ggdist", "withr", "simsurv", "gt")) |
21 | 21 |
|
22 | 22 |
|
23 | 23 | ## ----------------------------------------------------------------------------- |
24 | 24 | #| eval: false |
25 | | -## bamdd_zip <- tempfile(fileext=".zip") |
26 | | -## download.file("https://github.com/Novartis/bamdd/archive/refs/heads/main.zip", bamdd_zip) |
27 | | -## ## extracts web-site into the users home |
28 | | -## unzip(bamdd_zip, exdir=normalizePath("~")) |
29 | | -## browseURL(normalizePath(file.path("~", "bamdd-main"))) |
30 | | -## # to install all dependencies needed to build the web-site, please run |
31 | | -## source(file.path("~", "bamdd-main", "src", "install_dependencies.R")) |
| 25 | +# bamdd_zip <- tempfile(fileext=".zip") |
| 26 | +# download.file("https://github.com/Novartis/bamdd/archive/refs/heads/main.zip", bamdd_zip) |
| 27 | +# ## extracts web-site into the users home |
| 28 | +# unzip(bamdd_zip, exdir=normalizePath("~")) |
| 29 | +# browseURL(normalizePath(file.path("~", "bamdd-main"))) |
| 30 | +# # to install all dependencies needed to build the web-site, please run |
| 31 | +# source(file.path("~", "bamdd-main", "src", "install_dependencies.R")) |
32 | 32 |
|
33 | 33 |
|
34 | 34 | ## ----include=FALSE------------------------------------------------------------ |
35 | | -here::i_am("exercises/bamdd_paris2025_exercises.qmd") |
| 35 | +here::i_am("exercises/bamdd_graz2025_exercises.qmd") |
36 | 36 |
|
37 | 37 |
|
38 | 38 | ## ----warning = FALSE, message = FALSE----------------------------------------- |
@@ -118,7 +118,7 @@ map_mc_brms |
118 | 118 |
|
119 | 119 | ## ----------------------------------------------------------------------------- |
120 | 120 | #| eval: false |
121 | | -## region_model_fixed <- bf(r | trials(n) ~ 1 + region + (1 | study), family=binomial) |
| 121 | +# region_model_fixed <- bf(r | trials(n) ~ 1 + region + (1 | study), family=binomial) |
122 | 122 |
|
123 | 123 |
|
124 | 124 | ## ----------------------------------------------------------------------------- |
@@ -399,30 +399,30 @@ peanut |> |
399 | 399 |
|
400 | 400 | ## ----peanutmodel1------------------------------------------------------------- |
401 | 401 | #| eval: false |
402 | | -## model1 <- bf( #---- YOUR CODE HERE --- # ~ E0 + Emax * dose^h/(dose^h + ED50^h), |
403 | | -## family= #---- YOUR CODE HERE --- # , |
404 | | -## nlf(h ~ exp(logh)), nlf(ED50 ~ exp(logED50)), |
405 | | -## E0 ~ 1, logED50 ~ 1, logh ~ 1, Emax ~ 1, |
406 | | -## nl=TRUE) |
407 | | -## |
408 | | -## priors1 <- prior(normal(-2.944, 0.38), nlpar=E0) + |
409 | | -## prior(normal(0, 1), nlpar=logh) + |
410 | | -## prior(normal(0, 6), nlpar=Emax) + |
411 | | -## prior(normal(2.7, 2.5), nlpar=logED50) |
| 402 | +# model1 <- bf( #---- YOUR CODE HERE --- # ~ E0 + Emax * dose^h/(dose^h + ED50^h), |
| 403 | +# family= #---- YOUR CODE HERE --- # , |
| 404 | +# nlf(h ~ exp(logh)), nlf(ED50 ~ exp(logED50)), |
| 405 | +# E0 ~ 1, logED50 ~ 1, logh ~ 1, Emax ~ 1, |
| 406 | +# nl=TRUE) |
| 407 | +# |
| 408 | +# priors1 <- prior(normal(-2.944, 0.38), nlpar=E0) + |
| 409 | +# prior(normal(0, 1), nlpar=logh) + |
| 410 | +# prior(normal(0, 6), nlpar=Emax) + |
| 411 | +# prior(normal(2.7, 2.5), nlpar=logED50) |
412 | 412 |
|
413 | 413 |
|
414 | 414 | ## ----fitpeanutmodel1---------------------------------------------------------- |
415 | 415 | #| eval: false |
416 | | -## brmfit1 <- brm( |
417 | | -## formula = model1, |
418 | | -## prior = priors1, |
419 | | -## data = summarize(peanut, y=sum(CRIT1FL=="Y"), n=n(), .by=c(TRT01P, dose)) |
420 | | -## ) |
| 416 | +# brmfit1 <- brm( |
| 417 | +# formula = model1, |
| 418 | +# prior = priors1, |
| 419 | +# data = summarize(peanut, y=sum(CRIT1FL=="Y"), n=n(), .by=c(TRT01P, dose)) |
| 420 | +# ) |
421 | 421 |
|
422 | 422 |
|
423 | 423 | ## ----------------------------------------------------------------------------- |
424 | 424 | #| eval: false |
425 | | -## tibble(dose = seq(0, 300, 1), n=1) |> tidybayes::add_epred_rvars(brmfit1) |
| 425 | +# tibble(dose = seq(0, 300, 1), n=1) |> tidybayes::add_epred_rvars(brmfit1) |
426 | 426 |
|
427 | 427 |
|
428 | 428 | ## ----sol_peanutmodel1--------------------------------------------------------- |
|
0 commit comments