[R] Covariate model in nlme

Ben Bolker bbolker at gmail.com
Mon Feb 6 15:19:47 CET 2012


SHAILLY MEHROTRA <shaillymehrotra <at> gmail.com> writes:

> I am using nlme to fit a pharmacokinetic model. The base model is
> parameterized in terms of CL, V1, V2 and Q.
> 
> basemodel<-nlme(Conc ~TwoCompModel(CL,Q,V1,V2,Time,ID),
> data = data2, fixed=list(CL+Q+V1+V2~1),
> random = pdDiag(CL+V1+V2~1),
> start=c(CL=log(20),Q=log(252),V1=log(24.9),V2=log(120)),
> control=list(returnObject=TRUE,msVerbose=TRUE,
> msMaxIter=20,pnlsMaxIter=20,pnlsTol=1),
> verbose=TRUE).
> 
> Now, I want to include covariates (age and weight) in the base model. The
> relationships between CL and covariate is linear and given as the following
> equation.
> 
> CL=TVCL+a*wt-b*age, where TVCL is mean clearance, a and b are coefficients
> of weight and age, respectively.

  I believe you want something like

fixed=list(Q+V1+V2~1,CL~wt+age)

  Questions about mixed models may in general have better
success on the r-sig-mixed-models <at> r-project.org
mailing list.

 Ben Bolker



More information about the R-help mailing list