system_define_cohorts_nm: Define Cohorts from NONMEM Input File

View source: R/ubiquity.r

system_define_cohorts_nmR Documentation

Define Cohorts from NONMEM Input File

Description

This function allows the user to define cohorts automatically from a NONMEM dataset

Usage

system_define_cohorts_nm(
  cfg,
  DS = "DSNAME",
  col_ID = "ID",
  col_CMT = "CMT",
  col_DV = "DV",
  col_TIME = "TIME",
  col_AMT = "AMT",
  col_RATE = "RATE",
  col_EVID = "EVID",
  col_GROUP = NULL,
  filter = NULL,
  INPUTS = NULL,
  OBS = NULL
)

Arguments

cfg

ubiquity system object

DS

Name of the dataset loaded using system_load_data

col_ID

Column of unique subject identifier

col_CMT

Compartment column

col_DV

Column with observations or ’.’ for input

col_TIME

Column with system time of each record

col_AMT

Infusion/dose amounts (these need to be in the same units specified in the system.txt file)

col_RATE

Rate of infusion or ’.’ for bolus

col_EVID

EVID (0 - observation, 1 dose)

col_GROUP

Column name to use for defining similar cohorts when generating figures.

filter

List used to filter the dataset or NULL if the whole dataset is to be used (see filter rules or nm_select_records or a description of how to use this option)

INPUTS

List mapping input information in the dataset to names used in the system.txt file

OBS

List mapping obseravation information in the dataset to nams used in the system.txt file

Details

NOTE: to use this function it is necessary that a timescale be define for the system time scale. For example, if the system time scale was days, something like the following is needed:

<TS:days> 1

Include all records in the dataset

filter = NULL

Include only records matching the following filter

filter = list()
filter$COLNAME = c()

Mapping information:

The inputs mapping information (INPUTMAP) is alist with a field for each type of input: input:

  • bolus List with a name for each bolus state in the dataset (<B:?>): each bolus name should have a CMT_NUM field indicating the compartment number for that state

  • infusion_rates List with a name for each rate in the dataset (<R:?>): each rate name should have a CMT_NUM field indicating the compartment number for that state

  • covariates List with for each covariate in the dataset (<CV:?>): each covariate name should have a col_COV indicating the column in the database that contains that covariate

From a coding perspective it looks like this:

INPUTMAP = list()
INPUTMAP$bolus$SPECIES$CMT_NUM            =  1
INPUTMAP$infusion_rates$RATE$CMT_NUM      =  1
INPUTMAP$covariates$CVNAME$col_COV        = 'CNAME'

The observation mapping information (OBSMAP) is a list with elements for each output as described in for system_define_cohort. Each output is a list with the following names:

  • variance Variance model for this output

  • CMT Compartment number mapping observations for this output

  • output Name of the output (<O>) corresponding with the observations

  • missing Value indicating a missing observation or NULL

From a coding perspective it looks like this:

OBSMAP = list()
OBSMAP$ONAME=list(variance     = 'PRED^2',
                 CMT          =  1,
                 output       = '<O>',
                 missing      =  NULL )

Value

ubiquity system object with cohorts defined.

See Also

Estimation vignette (vignette("Estimation", package = "ubiquity"))


ubiquity documentation built on May 29, 2024, 12:02 p.m.