dreamer_data {dreamer} | R Documentation |
Generate Data from Dose Response Models
Description
See the model definitions below for specifics for each model.
Usage
dreamer_data_linear(
n_cohorts,
doses,
b1,
b2,
sigma,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_linear_binary(
n_cohorts,
doses,
b1,
b2,
link,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_quad(
n_cohorts,
doses,
b1,
b2,
b3,
sigma,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_quad_binary(
n_cohorts,
doses,
b1,
b2,
b3,
link,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_loglinear(
n_cohorts,
doses,
b1,
b2,
sigma,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_loglinear_binary(
n_cohorts,
doses,
b1,
b2,
link,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_logquad(
n_cohorts,
doses,
b1,
b2,
b3,
sigma,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_logquad_binary(
n_cohorts,
doses,
b1,
b2,
b3,
link,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_emax(
n_cohorts,
doses,
b1,
b2,
b3,
b4,
sigma,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_emax_binary(
n_cohorts,
doses,
b1,
b2,
b3,
b4,
link,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_exp(
n_cohorts,
doses,
b1,
b2,
b3,
sigma,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_exp_binary(
n_cohorts,
doses,
b1,
b2,
b3,
link,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_beta(
n_cohorts,
doses,
b1,
b2,
b3,
b4,
scale,
sigma,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_beta_binary(
n_cohorts,
doses,
b1,
b2,
b3,
b4,
scale,
link,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_independent(
n_cohorts,
doses,
b1,
sigma,
times,
t_max,
longitudinal = NULL,
...
)
dreamer_data_independent_binary(
n_cohorts,
doses,
b1,
link,
times,
t_max,
longitudinal = NULL,
...
)
Arguments
n_cohorts |
a vector listing the size of each cohort.
|
doses |
a vector listing the dose for each cohort.
|
b1 , b2 , b3 , b4 |
parameters in the models. See sections below for
each parameter's interpretation in a given model.
|
sigma |
standard deviation.
|
times |
the times at which data should be simulated if a longitudinal
model is specified.
|
t_max |
the t_max parameter used in the longitudinal model.
|
longitudinal |
a string indicating the longitudinal model to be used.
Can be "linear", "itp", or "idp".
|
... |
additional longitudinal parameters.
|
link |
character vector indicating the link function for binary models.
|
scale |
a scaling parameter (fixed, specified by the user) for the
beta models.
|
Value
A dataframe of random subjects from the specified model and
parameters.
Functions
-
dreamer_data_linear()
: generate data from linear dose response.
-
dreamer_data_linear_binary()
: generate data from linear binary dose response.
-
dreamer_data_quad()
: generate data from quadratic dose response.
-
dreamer_data_quad_binary()
: generate data from quadratic binary dose response.
-
dreamer_data_loglinear()
: generate data from log-linear dose response.
-
dreamer_data_loglinear_binary()
: generate data from binary log-linear dose response.
-
dreamer_data_logquad()
: generate data from log-quadratic dose response.
-
dreamer_data_logquad_binary()
: generate data from log-quadratic binary dose
response.
-
dreamer_data_emax()
: generate data from EMAX dose response.
-
dreamer_data_emax_binary()
: generate data from EMAX binary dose response.
-
dreamer_data_exp()
: generate data from exponential dose response.
-
dreamer_data_exp_binary()
: generate data from exponential binary dose response.
-
dreamer_data_beta()
: generate data from Beta dose response.
-
dreamer_data_beta_binary()
: generate data from binary Beta dose response.
-
dreamer_data_independent()
: generate data from an independent dose response.
-
dreamer_data_independent_binary()
: generate data from an independent dose response.
Linear
y∼N(f(d),σ2)
f(d)=b1+b2∗d
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
1/σ2∼Gamma(shape,rate)
Quadratic
y∼N(f(d),σ2)
f(d)=b1+b2∗d+b3∗d2
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
b3∼N(mub3,sigmab32)
1/σ2∼Gamma(shape,rate)
Log-linear
y∼N(f(d),σ2)
f(d)=b1+b2∗log(d+1)
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
1/σ2∼Gamma(shape,rate)
Log-quadratic
y∼N(f(d),σ2)
f(d)=b1+b2∗log(d+1)+b3∗log(d+1)2
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
b3∼N(mub3,sigmab32)
1/σ2∼Gamma(shape,rate)
EMAX
y∼N(f(d),σ2)
f(d)=b1+(b2−b1)∗d4b/(exp(b3∗b4)+d4b)
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
b3∼N(mub3,sigmab32)
b4∼N(mub4,sigmab42),(Truncatedabove0)
1/σ2∼Gamma(shape,rate)
Here, b1
is the placebo effect (dose = 0), b2
is the
maximum treatment effect, b3
is the log(ED50)
, and
b4
is the hill or rate parameter.
Exponential
y∼N(f(d),σ2)
f(d)=b1+b2∗(1−exp(−b3∗d))
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
b3∼N(mub3,sigmab32),(truncatedtobepositive)
1/σ2∼Gamma(shape,rate)
Linear Binary
y∼Binomial(n,f(d))
link(f(d))=b1+b2∗d
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
Quadratic Binary
y∼Binomial(n,f(d))
link(f(d))=b1+b2∗d+b3∗d2
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
b3∼N(mub3,sigmab32)
Log-linear Binary
y∼Binomial(n,f(d))
link(f(d))=b1+b2∗log(d+1)
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
Log-quadratic Binary
y∼Binomial(n,f(d))
link(f(d))=b1+b2∗log(d+1)+b3∗log(d+1)2
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
b3∼N(mub3,sigmab32)
EMAX Binary
y∼Binomial(n,f(d))
link(f(d))=b1+(b2−b1)∗d4b/(exp(b3∗b4)+d4b)
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
b3∼N(mub3,sigmab32)
b4∼N(mub4,sigmab42),(Truncatedabove0)
Here, on the link(f(d))
scale,
b1
is the placebo effect (dose = 0), b2
is the
maximum treatment effect, b3
is the log(ED50)
, and
b4
is the hill or rate parameter.
Exponential Binary
y∼Binomial(n,f(d))
link(f(d))=b1+b2∗(exp(b3∗d)−1)
b1∼N(mub1,sigmab12)
b2∼N(mub2,sigmab22)
b3∼N(mub3,sigmab32),(Truncatedbelow0)
Independent
y∼N(f(d),σ2)
f(d)=b1d
b1d∼N(mub1[d],sigmab1[d]2)
1/σ2∼Gamma(shape,rate)
Independent Binary
y∼Binomial(n,f(d))
link(f(d))=b1d
b1d∼N(mub1[d],sigmab1[d])2
Longitudinal Linear
Let f(d)
be a dose response model. The expected value of the
response, y, is:
E(y)=g(d,t)
g(d,t)=a+(t/tmax)∗f(d)
a∼N(mua,sigmaa)
Longitudinal ITP
Let f(d)
be a dose response model. The expected value of the
response, y, is:
E(y)=g(d,t)
g(d,t)=a+f(d)∗((1−exp(−c1∗t))/(1−exp(−c1∗tmax)))
a∼N(mua,sigmaa)
c1∼Uniform(ac1,bc1)
Longitudinal IDP
Increasing-Decreasing-Plateau (IDP).
Let f(d)
be a dose response model. The expected value of the
response, y, is:
E(y)=g(d,t)
g(d,t)=a+f(d)∗(((1−exp(−c1∗t))/(1−exp(−c1∗d1)))∗I(t<d1)+(1−gam∗((1−exp(−c2∗(t−d1)))/(1−exp(−c2∗(d2−d1)))))∗I(d1<=t<=d2)+(1−gam)∗I(t>d2))
a∼N(mua,sigmaa)
c1∼Uniform(ac1,bc1)
c2∼Uniform(ac2,bc2)
d1∼Uniform(0,tmax)
d2∼Uniform(d1,tmax)
gam∼Uniform(0,1)
Examples
set.seed(888)
data <- dreamer_data_linear(
n_cohorts = c(20, 20, 20),
dose = c(0, 3, 10),
b1 = 1,
b2 = 3,
sigma = 5
)
head(data)
plot(data$dose, data$response)
abline(a = 1, b = 3)
# longitudinal data
set.seed(889)
data_long <- dreamer_data_linear(
n_cohorts = c(10, 10, 10, 10), # number of subjects in each cohort
doses = c(.25, .5, .75, 1.5), # dose administered to each cohort
b1 = 0, # intercept
b2 = 2, # slope
sigma = .5, # standard deviation,
longitudinal = "itp",
times = c(0, 12, 24, 52),
t_max = 52, # maximum time
a = .5,
c1 = .1
)
## Not run:
ggplot(data_long, aes(time, response, group = dose, color = factor(dose))) +
geom_point()
## End(Not run)
[Package
dreamer version 3.1.0
Index]