Conditional Weighted Residuals

Conditional Weighted Residuals were proposed for NONMEM by Andrew Hooker.
Instructions on what to do to generate the appropriate piece of code are found
in Xpose's website. Emacs Speaks NONMEM helps with the generation by allowing

Appropriate Code to be generated depending on the version of NONMEM selected

Code to be reflective of the estimation method using. Currently, the default
method where conditional weighted residuals are generated is the first order
conditional estimation method. Other methods may be specified through the
menu:

Automation

Options

If you plan to use Perl Speaks NONMEM, you will need to select

Automation

Options

PsN compatibility — Use ../../ for .est files

This allows the .est files required for the calculation of conditional weighted
residuals to reside in the same directory as the rest of the files and the
control stream.

Large Tables

When there are over 20 PRED generated variables (or 50 in NONMEM VI.2 or
greater), NONMEM can not output the variables using one control stream. One
solution is to output the model specification, and use the same model to output
the missing variables. Last the variables should be merged together. Emacs
Speaks NONMEM can do this automatically when you save, and open as if there were
no limit to the number of variables that can be output. When there are more
variables output than can be interpreted by NONMEM, Emacs Speaks NONMEM modifies
and splits the files as follows:

The open control stream is stripped of variables over the 20/50 PRED
generated variable limit, and places comments at the end of the control
stream that allows NONMEM to know about these variables and open the base
control stream as if this translation did not occur.

Change the table names in this file to have a trailing ~0 in the file name.
For example a table output of patab1 would be changed to patab1~0

Create the appropriate number of control streams that read in the model
specification file and output variables that are missing from patab1~0. For
example,

For the first new control stream, run1.mod, create a new control stream
run1~1.mod that outputs tables where the variables are missing from the
table specified in run1.mod. For a table patab1, this control stream would
output patab1~1.

More control stream and table information are created if
necessary. (i.e. run1~2.mod, patab1~2, run1~3.mod, patab1~3, etc.

To produce the final table, you will need to:

Run the first control stream run1.mod. Once this has been completed, run
all subsequent control streams run1~2.mod, run1~3.mod, etc.

Merge the output datasets together to the final tables.

Note that you will have to create a script to paste the tables together line-by-line. An example of this using Xpose and R, is as follows:

After loading this function, the tables can be merged with xpose.merge(1).

This automatic splitting and reassembling can be toggled by:

NONMEM

Automatically...

Generate Code

Create multiple control streams to output more generated
variables than NONMEM can handle

Secondary Parameters Output

Another option that Emacs Speaks NONMEM allows is the generation of
secondary parameters for specific PK ADVAN/TRANS combinations. This
creates a section of code that generates useful secondary parameters
such as half-life when Emacs Speaks NONMEM can determine that the
parameter calculation applies.

For example, in a one-compartment model, Emacs Speaks NONMEM adds the following
parameters: