Hi Everyone,

I am trying to code a self-define model structure with ifelse statements in Phoenix nlme for a pop Pk model.

I would like to have a statement like this:

*test(){*

*covariate(Time)*

*stparm (Ac = Time=10? Ac=y0)*

*stparm(Dev = Time<Tin ? k*Ac-kel*Ac: -kel*Ac)*

*deriv(Ac = Dev)*

*error(AcEps = 1)*

*observe(AcObs(Time) = Ac+ AcEps )*

*fixef(tvTin= c(,1,))*

*fixef(tvk = c(, 1, ))*

*fixef(tvkel = c(, 1, ))*

*stparm(Tin = tvTin * exp(nTin))*

*stparm(kel = tvkel * exp(nkel))*

*stparm(k = tvk* exp(nk))*

*ranef(diag(nTin, nk, nkel) = c(1, 1, 1))*

*}*

Best,

Linda