Samples parameters from an IQRnlmeProject

Samples sets of population and / or individual parameters from an IQRnlmeProject. Different sampling types can be specified (see below).

sample_IQRnlmeProject(
  input,
  Nsamples = NULL,
  FLAG_SAMPLE = 0,
  covariates = NULL,
  FLAGid = FALSE,
  verbose = TRUE
)

Arguments

input

An IQRnlmeProject or a character string with the path to an IQRnlmeProject folder.

Nsamples

Number of samples to generate. If NULL number of samples is set equal set to number of rows of covariates.

FLAG_SAMPLE

Flag indicating the type of sampling:

FLAG_SAMPLE Meaning
=========== ===================================================
0 Use point estimates of population parameters (do not consider uncertainty) and sample Nsample individual patients based on these. Covariates considered if defined by user and used in model. Please note: population parameters do not take covariates into account!
1 Sample single set of population parameters from uncertainty distribution and sample Nsample individual patient parameters based on these. Covariates considered if defined by user and used in model. Please note: population parameters do not take covariates into account!
2 Sample Nsample sets of population parameters from uncertainty distribution. Do not sample from variability distribution and do not take into account covariates (even if user specified).
3 Use point estimates of population parameters (do not consider uncertainty) Return Nsamples sets of population parameters with covariates taken into account.
4 Sample single set of population parameters from uncertainty distribution Return Nsamples sets of population parameters with covariates taken into account.
5 Use point estimates of population parameters (do not consider uncertainty) and sample Nsample individual patients based on these. Covariates considered if defined by user and used in model. Population parameters, typical individual parameters (no IIV, but considering covariates), and individual parameters are returned.
6 Sample single set of population parameters from uncertainty distribution and sample Nsample individual patient parameters based on these. Covariates considered if defined by user and used in model. Sampled population parameters, typical individual parameters (no IIV, but considering covariates), and individual parameters are returned.
7 Same as FLAG_SAMPLE=0 but obtaining the empirical random effect covariance matrix from the post-hoc ETAs. Only used for IQRsysProject. If IQRnlmeProject then fallback to flag 0.
8 Same as FLAG_SAMPLE=1 but obtaining the empirical random effect covariance matrix from the post-hoc ETAs.
Only used for IQRsysProject. If IQRnlmeProject then fallback to flag 1.
covariates

Data frame or matrix. Column names need to contain names of the covariates. If Nsamples is set (not NULL) then there are 3 cases: if covariates is a data.frame wirh nrows as Nsamples then this is used as is. If nrows>Nsamples, sampling without replacement from the covariates is done and if nrows<Nsamples then sampling from covariates with replacement is done. Not all covariates that are used in the model need to be present.

FLAGid

If TRUE ID column is added to individual parameters (SAMPLE_FLAG = 0, 1, 5, or 6) or population parameters (SAMPLE_FLAG = 2, 3, 4, 5, or 6). Otherwise only data frames with parameters only are returned (default).

verbose

If TRUE then warnings are shown. If FALSE no warnings are shown but only errors.

Value

a named list with the following elements:

$FLAG_SAMPLE :

Same as the argument

$Nsamples :

Same as the argument

$covariatesSampled:

A data.frame having Nsample rows representing sampled records from the provided covariates.

$popParamValues:

A data.frame with columns for all population/typical individual parameter values, depending on the FLAG_SAMPLE settings (Values 2,3,4).

$typicalIndParamValues :

A data.frame of Nsample rows corresponding to the typical individual parameter values, basedo on popParamValues with taking into account the corresponding covariate values in $covariatesSampled but no variability. Only populated for FLAG_SAMPLE 5 and 6.

$indParamValues :

A data.frame with Nsamples rows containing the sampled individual parameter values in FLAG_SAMPLE cases for 0,1,7,8.

See also

Other IQRnlmeProject: IQRnlmeEst(), IQRnlmeProject(), addCovariateToModelSpec_IQRest(), addPar_modelSpec(), as_IQRnlmeProjectMulti(), as_IQRnlmeProject(), bootstrap_IQRnlmeProject(), compareModels_IQRnlmeProjectMulti(), convertETAINDIVPRED_IQRnlmeProject(), covariateEffect_IQRnlmeProject(), data_IQRest(), dosing_IQRest(), duplicate_IQRnlmeProject(), eigenvalues_IQRnlmeProject(), exportVirtualSubjects_IQRnlmeProject(), getData_IQRnlmeProject(), getETAs_IQRnlmeProject(), getEst_IQRnlmeProject(), getHeader_IQRnlmeProject(), getIndivParameters_IQRnlmeProject(), getIndivPredictions_IQRnlmeProject(), getModel_IQRnlmeProject(), getObsPred_IQRnlmeProject(), getPopParameters_IQRnlmeProject(), getResults_IQRnlmeProjectMulti(), getResults_IQRnlmeProject(), hasrun_IQRnlmeProjectMulti(), hasrun_IQRnlmeProject(), informationContent_IQRnlmeProject(), is_IQRnlmeEst(), is_IQRnlmeProjectMulti(), is_IQRnlmeProject(), is_MONOLIX_IQRnlmeProject(), is_NLMIXR_IQRnlmeProject(), is_NONMEM_IQRnlmeProject(), modelSpec_IQRest(), outlier_IQRnlmeProject(), plot.IQRnlmeProjectMulti(), plot.IQRnlmeProject(), plotBLQVPC_IQRdataVPC(), plotConvergence_IQRnlmeProject(), plotETACOV_IQRnlmeProject(), plotETA_IQRnlmeProject(), plotGOF_IQRnlmeProject(), plotINDIVSIM_IQRnlmeProject(), plotINDIV_IQRnlmeProject(), plotVPC_IQRdataVPC(), pred_IQRnlmeProject(), print.IQRnlmeEst(), print.IQRnlmeProjectMulti(), print.IQRnlmeProject(), print_modelSpec(), run_IQRnlmeProjectMulti(), run_IQRnlmeProject(), scm_IQRnlmeProject(), summary.IQRnlmeProjectMulti(), summary.IQRnlmeProject(), summaryComments_IQRnlmeProjectMulti(), summaryCorrelations_IQRnlmeProjectMulti(), summaryCovariates_IQRnlmeProjectMulti(), summaryParameters_IQRnlmeProjectMulti(), vpc_IQRnlmeProject()