Program Library 🔗

subprograms, modular, nested, function, call, run, execute, sample, scale, questionnaire

The Program Library is a collection of public programs we have created that you can use from your own programs using the *program keyword.

These are a few examples of the programs that are available:

  • Widely used measures covering personality, mental disorders, substance use and more:
    • Ten Item Personality Inventory (TIPI), IPIP-NEO-120, IPIP-HEXACO
    • PHQ Screeners, CAGE-AID Questionnaire, DASS-21, PTSD Checklist
    • PLC-5, Eating Disorder Diagnostic Scale, Levenson Self-Reported Psychopathy Scale
    • Van Westendorp Price Study, Bongard Problems, memory tests
  • Screening and demographic questions: list of countries, US states, education level, income, religiousness, political affiliation, employment
  • Mathematical operations: truncation, random number generation, factorial calculation, binary conversion, temperature conversion
  • Text functions: text trimming, text comparison, email address validation
  • Date handling: parsing a date in text format into a date type variable, getting the current date and time, day of the week calculation, current time conversion to Eastern Time
  • Display programs: display a collection as a table, display a list of items for the user to rank, cute animal pictures

Let's say you are preparing a study to find out if it is possible to know something about a person's personality by asking them if they like cheese or not. You will need to ask the participants if they like cheese and measure certain personality traits — for example, the Big Five . Here the Program Library comes in handy: instead of you coding a personality scale, why not use one of the measures we have already created? Use the search bar to find the scale you need by entering its name if you know it, or browsing by keywords. Search results that are programs from the library are labeled as such. Click on one of them and you will see a modal like this:

Program Library (1)

The modal displays the code needed to use this program from your own — which you can automatically insert by clicking on the "Insert" button on the lower right corner. Additionally, you can see the code of the program and run it in Preview mode to see what it does. You can also create your own copy of any program in the library to make changes and customize it to your needs.

Notice that there are some programs that require you to assign a value to some variables in order to run: e.g., if you want to calculate the factorial of a number, you need to let the program know what the number is. The generated code will guide you in populating these variables; just substitute the sample value we give you for the actual one.

Additionally there may be optional variables which will appear in a comment line. Note that optional variables come with a description and a default value. If you want to change this default value, uncomment the line and set the optional variable to the value that you choose.

--Enter the number whose factorial you need to find out
>>in_factorial = 4
-->>in_errorOutputValue: Value of out_factorial if there is an error calculating the factorial of the input value. DEFAULT: 0

*program: factorial - public
--out_factorialNotes: Notes on the attempt to determine (n!)

The factorial of {in_factorial} is {out_factorial}!