standrm: Dose-response models with rstan

Description Usage Arguments Details Value Author(s) Examples

Description

Formula interface for fitting dose-response curves with rstan

Usage

1
2
standrm(formula, data, fct, curveid = NULL, random = NULL,
        priors = standrc_priors(), ...)

Arguments

formula

A two-sided formula with response and dose covariate names

data

A dataframe containing the variables in the model

fct

A drc model function.

curveid

A two-sided formula with parameter names (b + c + d) on the left and a factor name on the right hand side, defining several clusters, modelled as fixed effects

random

A two-sided formula with parameter names (b + c + d) on the left and a factor name on the right hand side, defining several clusters, modelled as random effects

priors

A list with prior definitions, see standrc_priors

...

Additional arguments passed to function stan in ackage rstan

Details

The parameterization of the drc model functions is changed, modelling the slope and the asymmetry parameter on a logarithmic scale and allowing the lower and upper asymptotes to swap parameters. This might be problematic with three-parameter functions, fixing a specific asymptote by the fixed argument in a more complex model might be a better solution. Random effect parameters can be specified even when the fixed effects counterpart is fixed at a specific value, e.g. allowing cluster variation around a lower asymptote fixed at a response value of 0.

Value

stan_dat

rstan compatible list containing the data

model

A character vector containing the stan model

stan

S4 output of rstan containing the samples from the posterior distributions

pars

Character vector with fixed effects parameter names

random

Character vector with random effects parameter names

Author(s)

Daniel Gerhard

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
data(spinach)
head(spinach)

m <- standrm(SLOPE ~ DOSE, data=spinach, 
             fct=LL.5(fixed=c(NA, NA, NA, NA, 0)), 
             curveid=b + c + e ~ HERBICIDE, 
             random=c + e ~ CURVE, 
             iter=3000, chains=4)
print(m)
ranef(m)
VarCorr(m)

ED(m, respLev=c(25, 50, 75))


## End(Not run)

daniel-gerhard/standrc documentation built on May 14, 2019, 3:39 p.m.