Sample wrapper with syntax as sample_IQRnlmeProject for GPF excel files

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

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

Arguments

input

a filename (character string) denoting the path to a GPF excel file, or a GPF object.

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!
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 Should not be used by the normal user - used internally only. 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 Should not be used by the normal user - used internally only. 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.
covariates

a data.frame describing individual sets of covariate values. If nrow(data)==Nsamples, then all rows in data are returned (in their original order) in the resulting data.frame; if nrow(data)>Nsamples, sampling without replacement from the rows in data is done; if nrow(data)<Nsamples then sampling with replacement is done.

FLAGid

If TRUE ID column is added to individual parameters (SAMPLE_FLAG = 0, 1, 5, 6, 7, 8) or population parameters (SAMPLE_FLAG = 2, 3, 4). 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 and 1.

See also