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 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.