CVSPREPARE command
Stratifies a population, and calculates a statistically valid sample size for each stratum, for classical variables sampling.
Syntax
CVSPREPARE ON book_value_field NUMSTRATA number MINIMUM minimum_strata_sample_size PRECISION value CONFIDENCE confidence_level <CUTOFF value> NCELLS number PLIMIT {BOTH|UPPER|LOWER} ERRORLIMIT number <MINSAMPSIZE minimum_sample_size> TO {SCREEN|filename}
Parameters
Note
Do not include thousands separators, or percentage signs, when you specify values.
Name | Description |
---|---|
ON book_value_field | The numeric book value field to use as the basis for preparing the classical variables sample. |
NUMSTRATA number |
The number of strata to use for numerically stratifying the book_value_field. The minimum number of strata is 1, and the maximum is 256. If you specify NUMSTRATA 1, and do not specify a CUTOFF, the population is unstratified prior to drawing a sample. Note The number of strata cannot exceed 50% of the number of cells specified for NCELLS. |
MINIMUM minimum_strata_sample_size |
The minimum number of records to sample from each stratum. Leave the default of zero (0) if you do not have a specific reason for specifying a minimum number. |
PRECISION value |
The monetary amount that is the difference between the tolerable misstatement and the expected misstatement in the account.
The precision establishes the range of acceptability for an account to be considered fairly stated. Reducing the precision decreases the range of acceptability (the margin of error) which requires an increased sample size. |
CONFIDENCE confidence_level |
The desired confidence level that the resulting sample is representative of the entire population. For example, specifying 95 means that you want to be confident that 95% of the time the sample will in fact be representative. Confidence is the complement of "sampling risk". A 95% confidence level is the same as a 5% sampling risk.
|
CUTOFF value optional |
A certainty stratum cutoff value. Amounts in the book_value_field greater than or equal to the cutoff value are automatically selected and included in the sample. If you omit CUTOFF, a default cutoff value equal to the maximum amount in the book_value_field is used. |
NCELLS number |
The number of cells to use for pre-stratifying the book_value_field. Cells are narrower numeric divisions than strata. Pre-stratification is part of an internal process that optimizes the position of strata boundaries. Cells are not retained in the final stratified output. The minimum number of cells is 2, and the maximum is 999. Note The number of cells must be at least twice (2 x) the number of strata specified for NUMSTRATA. |
PLIMIT BOTH | UPPER | LOWER |
The type of precision limit to use.
|
ERRORLIMIT number |
The minimum number of errors you expect in the sample. Note If the actual number of errors you find when you analyze the sample is less than the ERRORLIMIT number, the only evaluation method available is mean-per-unit. |
MINSAMPSIZE minimum_sample_size optional |
The minimum number of records to sample from the entire population. Leave the default of zero (0) if you do not have a specific reason for specifying a minimum number. |
TO SCREEN | filename |
The location to send the results of the command to:
|
Analytics output variables
Name | Contains |
---|---|
CONFIDENCE | The confidence level specified by the user. |
ERRLIMIT | The minimum number of errors specified by the user. |
NSTRATA | The number of strata specified by the user. |
PLIMIT | The type of precision limit specified by the user. |
S_TOP | The certainty stratum cutoff value specified by the user, or if none was specified, the upper boundary of the top stratum calculated by the command. |
SAMPLEFIELD | The book value field specified by the user. |
SBOTTOM | The lower boundary of the bottom stratum calculated by the command. |
SBOUNDARY | All strata upper boundaries calculated by the command, and S_TOP. Does not store SBOTTOM. |
SPOPULATION | The count of the number of records in each stratum, and the total monetary value for each stratum. Excludes items above the certainty stratum cutoff. |
SSAMPLE | The sample size for each stratum calculated by the command. |
Examples
Prepare a classical variables sample
You have decided to use classical variables sampling to estimate the total amount of monetary misstatement in an account containing invoices.
Before drawing the sample, you must first stratify the population, and calculate a statistically valid sample size for each stratum.
You want to be confident that 95% of the time the sample drawn by Analytics will be representative of the population as a whole.
Using your specified confidence level, the example below stratifies a table based on the invoice_amount field, and calculates the sample size for each stratum and the certainty stratum:
CVSPREPARE ON invoice_amount NUMSTRATA 5 MINIMUM 0 PRECISION 928003.97 CONFIDENCE 95.00 CUTOFF 35000 NCELLS 50 PLIMIT BOTH ERRORLIMIT 6 MINSAMPSIZE 0 TO SCREEN
Remarks
Note
For more information about how this command works, see the Analytics Help.
Numeric length limitation
Several internal calculations occur during the preparation stage of classical variables sampling. These calculations support numbers with a maximum length of 17 digits. If the result of any calculation exceeds 17 digits, the result is not included in the output, and you cannot continue with the sampling process.
Note that source data numbers of less than 17 digits can produce internal calculation results that exceed 17 digits.