Main Content


Import NONMEM-formatted data


data = sbionmimport('Filename')
data = sbionmimport (nmds)
data = sbionmimport('Filename', nmdefObj)
data = sbionmimport(_,'ParameterName',ParameterValue)
data = sbionmimport(nmds,nmdefObj)
[data, PKDataObj] = sbionmimport(_)


data = sbionmimport('Filename') or data = sbionmimport (nmds) converts a NONMEM® formatted file, and assumes that the file is configured to use the following default values for column headers: ADDL, AMT, CMT, DATE , DV, EVID, ID, II, MDV, RATE, TIME. See Support for Importing NONMEM Formatted Files for more information on each of the headers.

data = sbionmimport('Filename', nmdefObj) imports a NONMEM formatted file named Filename, into a SimBiology formatted dataset data using the meanings of the file column headings defined in the NONMEM file definition object nmdefObj.

data = sbionmimport(_,'ParameterName',ParameterValue) accepts one or more comma-separated name-value pairs that are accepted by the readtable method. If additional information is required to read the file such as the delimiter, specify required name-value pairs. See readtable for a list of supported name-value pairs.

data = sbionmimport(nmds,nmdefObj) reads a NONMEM formatted dataset nmds and returns a groupedData object data. Each variable in nmds must be a column vector.

[data, PKDataObj] = sbionmimport(_) returns a PKData object, PKDataObj containing the dataset data. The PKDataObj properties show the labels specified in data.

Input Arguments


If extension of Filename is .xls or .xlsx, sbionmimport assumes it to be an Excel® file. Otherwise sbionmimport assumes Filename is a text file. sbionmimport reads the file using dataset (Statistics and Machine Learning Toolbox) or readtable.


NONMEM-formatted data, specified as a dataset (Statistics and Machine Learning Toolbox), table, or groupedData object. Each variable in nmds must be a column vector.


nmdefObj defines the meanings of the file column headings. nmdefObj is a NONMEM file definition object created using the sbionmfiledef function. It contains properties for specifying data items such as group, time, and date. You must specify the TimeLabel and the DependentVariableLabel properties.

When this argument is omitted or empty [], the default NONMEM interpretation is used.

Output Arguments


groupedData object. It contains a separate column for each dose and observation. The Description property of data contains a list of warnings, if any, that occurred while constructing data. To view the warnings, enter the following in the command line.



The PKData object defines the data to use in fitting and the roles of the columns used for estimation. For more information, see PKData object.


collapse all

Load a sample dataset.

load pheno ds;

The dataset contains 6 variables (columns). Display the names of these variables.

ans = 1x6 cell
    {'ID'}    {'TIME'}    {'DOSE'}    {'WEIGHT'}    {'APGAR'}    {'CONC'}

Define what these variables mean according to the NONMEM definition.

def = sbionmfiledef;
def.GroupLabel = 'ID';
def.TimeLabel = 'TIME';
def.DependentVariableLabel = 'CONC';
def.DoseLabel = 'DOSE'
def = 
  NMFileDef with properties:

                 CompartmentLabel: ''
        ContinuousCovariateLabels: {}
                        DateLabel: ''
           DependentVariableLabel: 'CONC'
                        DoseLabel: 'DOSE'
                DoseIntervalLabel: ''
                  DoseRepeatLabel: ''
                     EventIDLabel: ''
                       GroupLabel: 'ID'
    MissingDependentVariableLabel: ''
                        RateLabel: ''
                        TimeLabel: 'TIME'
                             Type: 'NMFileDef'

def.ContinuousCovariateLabels = {'WEIGHT', 'APGAR'};

Import the dataset.

data = sbionmimport(ds,def);

Load a sample dataset.

load pheno ds

Create a groupedData object.

grpData = groupedData(ds);

Use the groupedData object variable names and define what column headings or variables mean according to the NONMEM definition.

def = sbionmfiledef;
def.GroupLabel = grpData.Properties.GroupVariableName;
def.TimeLabel = grpData.Properties.IndependentVariableName;
def.DependentVariableLabel = 'CONC';
def.DoseLabel = 'DOSE';
def.ContinuousCovariateLabels = {'WEIGHT', 'APGAR'};

Import the dataset.

data = sbionmimport(grpData,def);

Version History

Introduced in R2010a