Sample or subset records from a matrix or a data.frame
sampleIDs.RdSample or subset records from a matrix or a data.frame
sampleIDs(data, Nsamples)Arguments
- data
a data.frame describing patient or other subject covariate and regressor data. 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.
- Nsamples
integer denoting the number of individuals in a population. Note: in the case of
FLAG_SAMPLE=2, this value is used to specify the number of populations (seeNpop). Default:if(is_IQRnlmeParamSpec(obj)) obj$Nsamples else 1L.
Value
a data.frame. If nrow(data)==Nsamples, then all rows in data are included (in their original order); if nrow(data)>Nsamples, sampling without replacement from the rows in data is done; if nrow(data)<Nsamples then sampling with replacement is done. The returned data.frame has a column ID set to the integers 1:Nsamples. If the original data object did have a column ID, this column is copied as a column ID0 in the returned data.frame.
See also
Random sampling of NLME model parameters
Other Parameter sampling:
calcIndParamValues(),
calcTypicalIndParamValues(),
combineGPF(),
generate_GPFFromIQRnlmeEst(),
generate_GPFFromIQRnlmeProject(),
generate_GPFFromProjectInfo(),
generate_GPFFromProjectInfoList(),
getCorMatrixUncertainty(),
getCovMatrixIIV(),
getCovMatrixUncertainty(),
getNamesAllParameters(),
getNamesCovariateParameters(),
getNamesCovariates(),
getNamesErrorParameters(),
getNamesIIVCorrParameters(),
getNamesIIVParameters(),
getNamesModelParameters(),
getParamEstimates(),
getParamTransformationTypes(),
imputeTYPEcol_GPF(),
is_GPF(),
is_IQRnlmeParamSpec(),
read_GPFFromCSV(),
read_GPFFromXLS(),
sampleIndParamValues(),
sampleParamFromUncertainty(),
sampleRandomEffects(),
sample_GPF(),
select_FromGPF(),
specifyParamSampling(),
transformParamToNormal(),
untransformParamFromNormal()
Examples
if (FALSE) { # \dontrun{
#See the examples for sampleIndParamValues:
?sampleIndParamValues
} # }
