emaxalt {clinDR} | R Documentation |
Fit 4- or 3-parameter Emax model substituting simpler curves if convergence not achieved.
Description
ML estimation for 4- and 3-parmeter Emax model. If the 4-parameter model is requested, it is estimated and the 3-parameter model is fit only if the 4-parameter estimation fails. If 3-parameter estimation fails, the linear, log-linear, or exponential model producing the smallest residual SS is substituted. For binary data, the model is fit on the logit scale and then back-transformed.
Usage
emaxalt(y, dose, modType=3,binary=FALSE,
iparm=NA,ed50cutoff=2.5*max(doselev),
ed50lowcutoff=doselev[2]/1000,switchMod= TRUE,
truncLambda=6)
Arguments
y |
Response vector |
dose |
Doses corresponding to |
modType |
When modType=4, the fitting begins with the 4 parameter model. If estimation fails or modType=3, the 3-parameter estimation is applied. If it fails, a best-fitting model linear in its parameters is selected. |
binary |
When specified, the Emax model is fit on the logit scale, and then the results are back-transformed to proportions. |
iparm |
Vector of optional initial values for the Emax fit. Starting values are computed if not specified. |
ed50cutoff |
Upper allowed limit for ED50 estimates. |
ed50lowcutoff |
Lower allowed limit for the ED50 estimates. |
switchMod |
If switchMod is TRUE, the algorithm substitutes a simpler model if (1) convergence is not achieved, (2) the information matrix is not positive definite at the converged values, (3) the ED50 estimates are outside the cutoff bounds. If switchMod is F, only conditions (1) or (2) cause a simpler model to be used. |
truncLambda |
When |
Details
The partial linear method is used in nls. If it fails, gauss-newton is attempted. If both methods fail, the next simpler model is attempted. For the 4-parameter model, the next step is the 3-parameter model. For the 3-parameter model, a linear, log-linear log(dose+1.0), and exp(dose/max(dose)) are fit using lm, and the 2-parm fit with the smallest residual SS is selected.
Value
A list assigned class "emaxalt" with the following elements:
dm |
Vector containing dose group means |
dsd |
Vector containing dose group SDs |
Sparm |
Vector of starting values for 3-parameter Emax fit. |
fitType |
Character vector with "4", "3", "L", "LL", or "E" for 4-Emax, 3-Emax, linear, log-linear, or exponential when an alternative model is selected. |
vc |
The variance-covariance matrix of the model parameters stored as a vector. The length is 16, 9, 4 depending on fitType. |
fitpred |
Dose groups means estimated from the model |
residSD |
The residual SD based on the selected model. |
sepred |
SEs for estimates in fitpred |
sedif |
SEs for model-based estimates of difference with placebo |
bigC |
bigC= TRUE if the primary fit (from modType) yielded an ED50 >ED50 upper limit. |
negC |
negC= TRUE if the primary fit (from modType) yielded a ED50 estimate < ED50 lower limit. |
est4 |
4-parmameter Emax fit (ed50,lambda,emax,e0). NA if failed to converge or 3-parameter model requested. |
est3 |
3-parmameter Emax fit (ed50,emax,e0). NA if failed to converge or 4-parameter model successfully fit. |
estA |
Alternative parameter estimates. NA if Emax model fit successfully |
Author(s)
Neal Thomas
See Also
Examples
save.seed<-.Random.seed
set.seed(12357)
doselev<-c(0,5,25,50,100)
n<-c(78,81,81,81,77)
dose<-rep(doselev,n)
### population parameters for simulation
e0<-2.465375
ed50<-67.481113
dtarget<-100
diftarget<-9.032497
emax<-solveEmax(diftarget,dtarget,log(ed50),1,e0)
sdy<-7.967897
pop<-c(log(ed50),emax,e0)
meanresp<-emaxfun(dose,pop)
y<-rnorm(sum(n),meanresp,sdy)
simout<-emaxalt(y,dose)
simout2<-emaxalt(y,dose,modType=4)
.Random.seed<-save.seed