-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
76 lines (60 loc) · 2.25 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# DoseFinding
<!-- badges: start -->
[](https://CRAN.R-project.org/package=DoseFinding)
<!-- badges: end -->
The DoseFinding package provides functions for the design and analysis of dose-finding experiments (for example pharmaceutical Phase II clinical trials). It provides functions for: multiple contrast tests, fitting non-linear dose-response models, a combination of testing and dose-response modelling and calculating optimal designs,
both for normal and general response variable.
## Installation
You can install the development version of DoseFinding from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("bbnkmp/DoseFinding")
```
## Examples
### Performing multiple contrast tests
```{r example1, warning = FALSE, message=FALSE}
library(DoseFinding)
data(IBScovars)
## set random seed to ensure reproducible adj. p-values for multiple contrast test
set.seed(12)
## perform (model based) multiple contrast test
## define candidate dose-response shapes
models <- Mods(linear = NULL, emax = 0.2, quadratic = -0.17,
doses = c(0, 1, 2, 3, 4))
## plot models
plot(models)
## perform multiple contrast test
MCTtest(dose, resp, IBScovars, models=models,
addCovars = ~ gender)
```
### Fitting non-linear dose-response model
```{r example2}
## fit non-linear emax dose-response model
fitemax <- fitMod(dose, resp, data=IBScovars, model="emax",
bnds = c(0.01,5))
## display fitted dose-effect curve
plot(fitemax, CI=TRUE, plotData="meansCI")
```
### Optimal designs for dose estimation
```{r example3}
## Calculate optimal designs for target dose (TD) estimation
doses <- c(0, 10, 25, 50, 100, 150)
fmodels <- Mods(linear = NULL, emax = 25, exponential = 85,
logistic = c(50, 10.8811),
doses = doses, placEff=0, maxEff=0.4)
plot(fmodels, plotTD = TRUE, Delta = 0.2)
weights <- rep(1/4, 4)
optDesign(fmodels, weights, Delta=0.2, designCrit="TD")
```