• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
        • ValueSet Statement
        • ValueSet.add Function
        • ValueSet.remove Function
        • ValueSet.clear Function
        • ValueSet.length Function
        • ValueSet.randomize Function
        • ValueSet.show Function
        • ValueSet.sort Function
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

ValueSet.randomize Function

Format
b = valueset_name.randomize(ʃexclude(exclude_code1, ..., exclude_codeN)ʅ);
Description
The ValueSet.randomize function scrambles the order of values in the ValueSet object. The function is useful when using capture types in a data entry application. Some survey applications choose to display the possible response categories in a randomized way so as to minimize an enumerator or respondent's selection bias.
An optional exclusion list, exclude_code1, ..., exclude_codeN, allows you to prevent certain values from being given a random order. This is useful for variables like Don't Know, which, after the randomization, would remain at the original location in the list of values.
You can use the seed function to initialize the random number generation.
Return Value
The function returns a logical value of 1 (true).
Example
FAVORITE_FOOD_GROUP_VS1.randomize(exclude(5));
  becomes  
See also: ValueSet Object, Random Function, RandomIn Function, Seed Function, ValueSet.sort Function