system_define_cohort: Define Estimation Cohort

Description Usage Arguments Details Value See Also

View source: R/ubiquity.r

Description

Define a cohort to include in a parameter estimation

Usage

1
system_define_cohort(cfg, cohort)

Arguments

cfg

ubiquity system object

cohort

list with cohort information

Details

Each cohort has a name (eg d5mpk), and the dataset containing the information for this cohort is identified (the name defined in system_load_data)

1
2
3
cohort  = c()
cohort$name    =d5mpkcohort$dataset =pmdata

Next it is necessary to define a filter (cf field) that can be applied to the dataset to only return values relevant to this cohort. For example, if we only want records where the column DOSE is 5 (for the 5 mpk cohort). We can

1
cohort$cf$DOSE = c(5)

If the dataset has the headings ID, DOSE and SEX and cohort filter had the following format:

1
2
3
cohort$cf$ID   = c(1:4)
cohort$cf$DOSE = c(5,10)
cohort$cf$SEX  = c(1)

It would be translated into the boolean filter:

1
((ID==1) | (ID==2) | (ID==3) | (ID==4)) & ((DOSE == 5) | (DOSE==10)) & (SEX == 1)

Next we define the dosing for this cohort. It is only necessary to define those inputs that are non-zero. So if the data here were generated from animals given a single 5 mpk IV at time 0. If in the model this was defined using <B:times> and <B:events> dosing into the central compartment Cp, you would pass this information to the cohort in the following manner:

1
2
cohort$inputs$bolus$Cp$AMT   = c(5)
cohort$inputs$bolus$Cp$TIME  = c(0)

Inputs can also include any infusion rates (infusion_rates) or covariates (covariates). Covariates will have the default value specified in the system file unless overwritten here. The units here are the same as those in the system file

Next we need to map the outputs in the model to the observation data in the dataset. Under cohort.outputs there is a field for each output. Here the field ONAME can be replaced with something more useful (like PK). The times and observations in the dataset are found in the ’TIMECOL’ column and the ’OBSCOL’ column (optional missing data option specified by -1). These are mapped to the model outputs (which MUST have the same units) ’TS’ and ’MODOUTPUT'. The variance model 'VARMOD' is a string containing the variance model written in terms of the model prediction (PRED), variance parameters (defined with <VP> in the system file), and numbers. To do a least squares

1
2
3
4
5
6
cohort$outputs$ONAME$obs$time        =TIMECOLcohort$outputs$ONAME$obs$value       =OBSCOLcohort$outputs$ONAME$obs$missing     = -1         
cohort$outputs$ONAME$model$time      =TS'       
cohort$outputs$ONAME$model$value     = ’MODOUTPUT’  
cohort$outputs$ONAME$model$variance  = ’VARMOD'

Note: Output names should be consistent between cohorts so they will be grouped together when plotting results.

Optionally we can add information about the markers to use when plotting the output for this cohort:

1
2
3
cohort$outputs$ONAME$options$marker_color   = 'black'
cohort$outputs$ONAME$options$marker_shape   = 16
cohort$outputs$ONAME$options$marker_line    = 1 

Lastly we define the cohort:

Value

ubiquity system object with cohort defined

See Also

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


john-harrold/ubiquity documentation built on Dec. 5, 2019, 3:29 p.m.