R Code

R-code for PoC and dose estimationt under model uncertainty with binary responses in a parallell design

For an example, see the Sample R code sampleRcode and refer to the paper.

The code automatically sources in the following two files:

    1. R-function for specifying and plotting candidate models: plotModels

Input: Dose, candidate models and optional guesses for  placebo effect (low) and efficacy at maximum dose (high). For three-parameter models, you need to specify when defining the model at which dose you expect the maximum efficacy to occur (dmax).

Output: Trellis plot of candidate models. (For plotting and fitting non-linear models, you need to source nonlin_dr.r. If you want to plot and fit models with an identity or log-log link, specified via “family=binomial(link=identity)” or “family=binomial(link=loglog)” directly, source these slightly amended basic R functions: binomial1.r and makelink.r)

    1. R-function for obtaining adjusted P-values and MED estimates: perm_minP_GLM

Input: Dose, response (preferrably as resp=cbind(y,n), where y is the number of successes and n the sample size at the dose levels), candidate models. Output: Critical value c for test of PoC, adjusted p-values for candidate models; MED estimate, various summary functions.