Supported Statements

Blocks are sets of statements grouped together inside curly brackets. Statements include assignment of values and variables. Statements within the model (and within blocks) can span multiple lines of code, and can be separated with (optional) semicolons.

In the following table:

var is a variable name
varlist is a list of variables, optionally separated by commas
numlist is a list of numbers, optionally separated by commas
assign is an assignment operator
expr is any numerical expression, including variable names, numbers and arithmetic operators
[ …] indicates the content of the brackets is optional
| represents “or” and separates options
* means zero or more of an item can be displayed
+ means one or more of an item can be displayed
statement is a statement of the form: variable=expression 

Statement

Purpose

cfMacro(id,parameters,
[strip=stripping_dose_covari­ate])

Macro-parameter model of concentration, using optional stripping dose.

cfMacro(id,parameters,
[first=abs_cpt_name])

Macro-parameter model of amount in central compart­ment (cpt).

cfMicro(id,parameters,
[first=abs_cpt_name])

Micro-parameter model. See “One-compartment first-order absorption, closed-form”.

count(var,expr[,action])

Defines an occurrence count.

covariate(var(var)*)

Defines one or more variables as covariates.
Include an empty pair of parentheses after the covariate name to indicate that it is categorical.
covariate(dose,time,Gender()) 

delay(expression,
MeanDelayTime
[ , shape=ShapeExpression]
[ , hist=HistExpression])

Models delayed outcomes using convolution of the signal to be delayed (S) and the probability density function (g) of the delay time.

MeanDelayTime: The value (positive) associated with the mean delay time.

ShapeExpression: The value (positive) representing the shape parameter that defines the distribution of the delay time.

HistExpression: The value of the expression prior to time 0.

Any number of delay functions can be included in a model. The MeanDelayTime and shape parameters can be estimated. See also “Discrete and distributed delays”.

delayInfCpt(A,
MeanDelayTime,
ShapeParamMinusOne [ ,
in=inflow][ , out=outflow])

A statement related to a compartment (that can receive a dose through a dosepoint statement) with all of its input delayed (where the delay time is assumed to be gamma distribution), including the rate of administered dose (if provided) and the inflow specified by the “in” option (if provided).

A: Name of the compartment.

MeanDelayTime: The value (positive) associated with the mean delay time.

ShapeParamMinusOne: The value (non-negative) rep­resenting one less than the shape parameter that defines the distribution of the delay time.

out=outflow: (Optional) Represents the flow out of compartment A.

in=inflow: (Optional) Represents the additional inflow that is delayed.

See also “Discrete and distributed delays”.

deriv(var assign expr)

Defines a differential equation.
deriv(a=-a*Cl/V) 

dosepoint| dosepoint2(id
[ tlag=expr]
[ duration=expr]
[ rate=expr])

Defines dosing. Example:
dosepoint(a1)
deriv(a1=-a1*ke1)
c1=a1/v1
dosepoint(a2)
deriv(a2=-a2*ke2)
c2=a2/v2
 

error(var(var)(*))

Defines the error statement. Examples:

error(CEps = 0.1) 
error(Ceps(freeze) 

event(var,expr)

Defines an unscheduled (e.g., adverse) event, where var is an occur variable, expr is its hazard.
event(occur,haz) 
The occur variable can be:

0=did not occur

1=occurred at the given time

2=occurred at least once in the prior interval

–n=occurred n times in the prior interval

–999999=no information about the prior interval

fixef(var[()][ (enable=int)]
[=([lower bound],[ initial esti­mate],[ upper bound])]

Defines variable(s) as fixed effects parameters, optionally with a fixed value (), with optional initial estimate and bounds.
fixef
tvE0=c(1,2,3)
tvEMax=c(4,5,6)
tvlEC50=c(0.09,1.1,2.0)
tvLambda=c(1,2,3)
 
See also “Fixed effect parameter syntax”.

interpolate(id(id) (*))

For more on the interpolate statement, see “Covariates”.

LL(obsvar,expr)

Defines log-likelihood where obsvar is the observation variable, expr is its log-likelihood.

multi(var,invlink(,expr)*[ ,action])

Defines an integer-valued categorical observation, where invlink is an inverse link function and the rest is a series of ascending offset expressions.
multi(Y,ilogit,-C*slope+intercept0, -C*slope+intercept1), …) 

observe(id1[ (i d2)]
[=expr][ ,bql]
[ ,dobefore={ …}]
[ ,doafter={ …}])

Defines predicted observations, where id1 is the Gauss­ian prediction variable, id2 is the independent variable, and expr is the value assigned to id1.
observe(cObs=cpred+eps1) 

ordinal(var,invlink,input,slope, (,intercept)*)

Variation on the multi statement.
ordinal(Y,ilogit,C,slope,inter­cept0,intercept1) 

Tmax=peak(Cmax=C)
or Tmax=peak(Cmax=C, max)
or Tmax=peak(Cmax=C, max=(t < 6))
or Tmin=peak(Cmin=C, min)
or Tmin=peak(Cmin=C, min=(t >= 6))
where Cmax and Cmin are the internal variables and do not need defining.

Use in model code (not in a sequence block, doafter, or dobefore).
Cmax, Tmax, Cmin, Tmin are variable names of user choice, and C is any user-written expression.
Variables Tmax and Cmax are initially 0, and hold their value until after a peak is detected.
After a peak is detected, variables Tmax and Cmax are set to the peak of a cubic spline fitted to the points around the peak, where the points are what is seen on the trajectory of the differential equations.
peak.png
If a subsequent peak is found, the process will only be repeated if the peak is higher than the first.
If the keyword max is not included, it is assumed.
If the keyword min is included, it will look for a trough rather than a peak.
Either keyword, max or min may be followed by a logical expression, such as max=test. In that case, it test is true, it looks for a peak. If test is false, it looks for the opposite.

peakreset(Cmax)

Use in a sequence block, doafter, or dobefore.
This statement takes place at a point in time and will reset the peak-finder, after which it can detect another peak.

proc{ statement*}

 

ranef((block(varlist)=numlist)*)

Defines variable(s) as random effects parameters, optionally defining the covariance matrix.
ranef(nlKe=0.01,nlV=0.01)
ranef(eta1,eta2=6
diag(eta5,eta6)=c(1,3)
same(eta7,eta8)
block(eta11,eta12)=c(1,2,3)
)
 
See also “Random effect parameter syntax”.

section(<int>,section-stmt)

 

sequence{ statement*}

Defines a block of statements to be executed together and can contain conditional statements. It can contain special statements:

if statements set statements to be executed condi­tional on expr being true
 if(expr){statement*}
 [ else if(expr){statement*}]*
 [ else {statement*}]
 

while statements set zero or more statements to be executed while expr is true
 while (expr){statement*} 

sleep statements pause computations for expr time units. (The expr value for the sleep statement is a relative time, not an absolute time.)
 sleep (expr) 

See “Modeling discontinuous events”, “One-compartment model with sequence”, and “One-compartment model with sleep statement”.

stparm((var | var=expr) +)

Defines one or more structural model parameters, var, with optional values, expr.
stparm(
 ka=exp(tvlKa+nlKa)
 ke=exp(tvlKe+nlKe)
 v=exp(tvlV+nlV)
)
 

urinecpt(var assign expr)

Defines an elimination compartment.
The urinecpt is like deriv, except in a steady state dosing situation, urinecpt is ignored.

 


Last modified date:6/26/19
Certara USA, Inc.
Legal Notice | Contact Certara
© 2019 Certara USA, Inc. All rights reserved.