fitEmax {clinDR} | R Documentation |
ML fit of hyperbolic or sigmoidal Emax models to continuous/binary dose response data.
Description
Calls Newton-Raphson optimizers, nls and nlm, for a hyperbolic or sigmoidal Emax model. Different intercepts for multiple protocol-data are supported. For binary data, the Emax model is on the logit scale.
Usage
fitEmax(y,dose,iparm,xparm,modType=4,
prot=rep(1,length(y)),count=rep(1,length(y)),xbase=NULL,
binary=FALSE,diagnostics=TRUE,msSat=NULL,
pboAdj=rep(FALSE,max(prot)),optObj=TRUE)
Arguments
y |
Outcome for each patient. Missing |
dose |
Dose for each patient. |
iparm |
Optional starting values for the Newton-Raphson algorithm. The order of the variables is (log(ED50),Emax,E0) or (log(ED50),lambda,Emax,E0). Note the transformation of ED50. If there is more than one protocol, the E0 is automatically duplicated. |
xparm |
Optional starting values for the baseline covariate slopes (if any).
|
modType |
modType=3 (default) for the 3-parameter hyperbolic Emax model. modType=4 for the 4-parameter sigmoidal Emax model. |
prot |
Protocol (group) membership used to create multiple intercepts. The default is a single protocol. |
count |
Counts for the number of patients when the |
xbase |
A matrix of baseline covariates with rows corresponding to
|
diagnostics |
Print trace information per iteration and any error messages from the optimizing methods. Printing can be suppressed for use in simulation studies. |
binary |
When |
msSat |
If continuous |
pboAdj |
For published data with only pbo-adjusted dose group means and
SEs, the model is fit without an intercept(s). If initial parameters
are supplied, the intercept (E0) should be assigned |
optObj |
Include the output object from the R optimization code in the |
Details
Fits the 3- or 4- Emax model using
nls
. A newton-raphson algorithm is tried first
followed by a partial linear optimatization if needed. Binary
data are fit using nlm
.
Value
A list assigned class "fitEmax" with:
fit |
The parameter estimates and their variance-covariance matrix. |
y , dose , modType , prot , count , binary , pboAdj |
Input values. |
gofTest |
Goodness of fit p-value based on likelihood ratio comparison of the model to a saturated fit. |
nll |
|
df |
Residual degrees of freedom for the Emax model and the saturated model. |
optobj |
When requested, the fit object returned by the R optimation functions. |
Author(s)
Neal Thomas
See Also
nls
, nlm
, nllogis
,
predict.fitEmax
, plot.fitEmax
, coef.fitEmax
Examples
## the example changes the random number seed
doselev<-c(0,5,25,50,100,350)
n<-c(78,81,81,81,77,80)
### population parameters for simulation
e0<-2.465375
ed50<-67.481113
dtarget<-100
diftarget<-9.032497
emax<-solveEmax(diftarget,dtarget,log(ed50),1,e0)
sdy<-8.0
pop<-c(log(ed50),emax,e0)
dose<-rep(doselev,n)
meanlev<-emaxfun(dose,pop)
y<-rnorm(sum(n),meanlev,sdy)
testout<-fitEmax(y,dose,modType=4)