Learn R Programming

clinDR (version 2.4.1)

nllogis: The negative log likelihood function for a 3- or 4- parameter Emax model on the logit scale for binary dose response.

Description

The negative log likelihood function evaluated with a single input set of parameters for the binary Emax model on the logistic scale. For use with function fitEmax

Usage

nllogis(parms,y,dose,
          prot=rep(1,length(y)),
          count=rep(1,length(y)),
          xbase=NULL)

Value

Negative log likelihood value is returned.

Arguments

parms

Emax model parameter values. The order of the variables is (log(ED50),Emax,E0) or (log(ED50),lambda,Emax,E0). There must be an E0 for each protocol. Note the transformation of ED50.

y

Binary outcome variable for each patient. Missing values are deleted. Must be coded 0/1.

dose

Dose for each patient

prot

Protocol (group) membership used to create multiple intercepts. The default is a single protocol. The value of prot must be 1,2,3,..

count

Counts for the number of patients with each dose/y value. Default is 1 (ungrouped data).

xbase

Optional matrix of baseline covariates that enter the model linearly. If there is a single covariate, it should be converted to a matrix with one column.

Author

Neal Thomas

Details

The negative log likelihood for the 3- or 4- Emax model on the logit scale for binary data. Note the ordering of the parameters and their transformations. A 3 vs 4 parameter model is deterimined by the length of parms.

See Also

nlm, fitEmax

Examples

Run this code
data('metaData')
exdat<-metaData[metaData$taid==8,]

cy<-round(exdat$sampsize*exdat$rslt)
y<-c(rep(1,length(cy)),rep(0,length(cy)))
cy<-c(cy,exdat$sampsize-cy)
drep<-c(exdat$dose,exdat$dose)
plotD(exdat$rslt,exdat$dose,se=FALSE)
nllogis(parms=c(log(2.5),-3.26,-0.15), y, drep,count=cy)

Run the code above in your browser using DataLab