checkMonoEmax {clinDR}R Documentation

Bayes posterior predictive test for Emax (monotone) model fit

Description

Bayes posterior predictive test for an Emax (monotone) model fit comparing the best response from lower doses to the response from the highest dose. checkMonoEmax is deprecated. See bpchkMonoEmax.

Usage

checkMonoEmax(y, 
      dose, 
      parm, 
      sigma2,
      nvec=rep(1,length(dose)),
      xbase=NULL,
      modelFun=emaxfun,
      trend='positive',
      binary= FALSE,logit=binary)

Arguments

y

Outcomes. Continuous y can be individual data or group means. Binary y can be individual data, group proportions, or 0/1 data with correspondng counts, as is required by fitEmaxB.

dose

Doses corresponding to outcomes

parm

Matrix of simultated parameter values (each row is a simulated parameter vector). The parm values must be constructed for use in the model function modFun. The default is a 4-parameter Emax model with parameters (log(ED50),lambda,Emax,E0). For a 3-parameter model, set lambda=1 for each simulated parameter vector.

sigma2

Simulated draws from the residual variance (assumed additive, homogeneous). The length of sigma2 must be the same as the number of rows of parm. sigma2 is ignored when binary=TRUE

nvec

The number of observations contributing to each y. The default is 1 for patient-level data.

xbase

Optional covariates matching y. nvec must be 1 (patient-level) data. The coeficients for xbase are the final columns of parm.

modelFun

The mean model function. The first argument is a scalar dose, and the second argument is a matrix of parameter values. The rows of the matrix are random draws of parameter vectors for the model. The default function is the 4-parameter Emax function emaxfun.

trend

The default is 'positive', so high values for lower doses yield small Bayesian predictive probabilities. Set trend to 'negative' for dose response curves with negative trends.

binary

If TRUE, the inverse logit transform is applied to the (Emax) function output for comparison to dose group sample proportions, and the predictive data are sampled from a binomial distribution.

logit

logit is deprecated, use binary

Details

A sample of parameters from the joint posterior distribution must be supplied (typically produced by an MCMC program). The Bayesian predictive p-value is the posterior probability that a dose group sample mean in a new study with the same sample sizes would yield a higher (or lower for negative trend) difference for one of the lower doses versus the highest dose than was actually obtained from the real sample. There must be at least two non-placebo dose groups (NA returned otherwise). Placebo response is excluded from the comparisons.

The function generates random numbers, so the random number generator/seed must be set before the function is called for exact reproducibility.

Value

Returns a scalar Bayesian predictive p-value.

Author(s)

Neal Thomas

See Also

plot.plotB, plotD, plot.fitEmax

Examples

## Not run: 

data("metaData")
exdat<-metaData[metaData$taid==6 & metaData$poptype==1,]

prior<-emaxPrior.control(epmu=0,epsca=10,difTargetmu=0,difTargetsca=10,dTarget=80.0,
        p50=3.75,sigmalow=0.01,sigmaup=20)
mcmc<-mcmc.control(chains=3)

msSat<-sum((exdat$sampsize-1)*(exdat$sd)^2)/(sum(exdat$sampsize)-length(exdat$sampsize))
fitout<-fitEmaxB(exdat$rslt,exdat$dose,prior,modType=4,
				count=exdat$sampsize,msSat=msSat,mcmc=mcmc)
parms<-coef(fitout)[,1:4]  #use first intercept

checkMonoEmax(y=exdat$rslt, dose=exdat$dose, parm=parms, sigma2=(sigma(fitout))^2,
      nvec=exdat$sampsize, trend='negative')
      

## End(Not run)


[Package clinDR version 2.4.1 Index]