Every researcher and research team has its own way of doing things, such as cleaning data, standard analyses, standard reporting workflows, etc. Skills let you encode epxertise into Displayr so that anybody can apply it consistently. A skill is a set of instructions for AI, that you can save and re-use, and that AI can find and use when answering your queries in Chat. This article covers:
- When to use skills
- Where to find skills (the skills menu)
- Creating new skills
- Running skills
- Worked example: Calculate Market Share
- Best Practices
When to use skills
Skills encode expertise so that it is reusable. They are useful when:
- You perform the same task repeatedly.
- Multiple people need to follow the same process.
- Your organization has a preferred methodology.
- You want consistent outputs from AI.
This table describes when to use skills versus other technologies:
| If you want to | Use |
| Ask AI to do something | Chat |
| Save a chart, analysis, or pages to re-use | Templates |
| Save a set of instructions for colleagues or AI to re-use in the future | Skills |
| Automate by writing code | QScript |
Where to find skills (the skills menu)
The skills menu is located in Chat, immediately below where it say Ask anything.... By clicking on Skills, you can see the skill that you have created, can edit, and can modify. Additional skills are run in the background by Displayr; you can't edit or view this.
When you start, there will be no skills. You need to create them. (Displayr comes with lots of pre-made skills that run in the background; you can't edit or inspect these.)
Creating new skills
There are three ways to create a new skill:
- Click on the Skills menu and click New, and filll in the fields. This is discussed in detail in Worked examples > Market share.
- Create a new file and save it into the Displayr Cloud Drive (see Advanced Skills for more detail).
- Ask Chat to create a skill.
Saving skills
When you save a skill, it's saved into a folder in the Displayr Cloud Drive. The skill is only available when editing documents in that folder and in sub-folders. For more detail, see Advanced Skills.
Running skills
Skills are run by:
- Selecting them from the Skills menu. This causes a prompt to be added, and you run it by sending it to chat (click the arrow).
- Typing a reference to them in the Chat prompt box and running it.
- Asking the AI to do something in Chat, and the AI reading through the descriptions of the various skills and working out that the skill is relevant, and running it itself.
Worked example: A skill for calculating market share
This worked example is designed to illustrate key apects of how to create skills. More advanced functionallity is provided in the worked exmples in the Advanced Skills article.
This example creates a new skill called market-share for calculating market share using survey data. To add this skill follow these steps:
- Click the Skills button and select New.
- Set the Name to market-share. Skills need to be named in lowercase with a dash between words (e.g., market-share rather than Market Share).
- The Description is used by users and the AI to work out what the skill does. E.g., Calculates market share for brands or companies from survey data, using the best available behavioural proxy (brand bought/used most often, last brand bought, or favorite brand).
- The When to use field gives the AI guidance to help it choose between skills. E.g., Use whenever the user asks for market share, brand share, share of market, or share by brand or company — including when they describe that goal without using the word 'share'.
- The Instructions describe what is meant to happen when you run the skill. The clearer these instructions, the better. There's more about this in Best Practices.
# Find a market share proxy
If the user has mentioned a specific variable or variable set, use it. Otherwise, identify the variable set in the study that is the best proxy for market share. Common variables (best is highest in the list) are:
- Last brand purchased or consumed
- Most common or main brand purchased or consumed
- Favorite brand
We refer to this as "Market Share Proxy"
If no proxy exists, tell the user you couldn't find one, and ask them to suggest one.
# Duplicate the variable set
Duplicate the Market Share Proxy
# Set the name for the new variable set
1. Set the base name of the newly created variable set to "Market Share".
2. If the user has given a rationale, append a short relevant qualifier to the base name.
3. If a variable set with that name already exists, make it unique by appending a space and the lowest integer that produces an unused name (e.g. "Market Share 1", then "Market Share 2", and so on).
4. Set the Label property of the newly created variable set to this final name.
# Create a table, rebase, and sort
1. Create a table of Market Share as a single output
2. If Market Share has an Other option, and it has a messy label (e.g., "other (specify)"), rename it as Other
3. Set any options that aren't brands or Other to missing values (e.g., don't know, none of these)
4. Sort the categories (using the Data Reduction; do not use a Rule), from highest to lowest, leaving NET and Other at the bottom.
Best Practices
Give telegraphic names
Good skills have names that explain exactly what they do. For example, market-share is much better than analysis or john-1.
Start simple and test
The examples above are quite detailed. However, often a simpler skill will do the job. The best approach is to write something simple and test. Only invest in more complexity if it's required. More about the general way to think about skills is in this webinar.
Encode expertise (not guesses)
Only put steps into a skill that you're sure are right. It's tempting to guess, but when you do that all you are doing is preventing the AI from figuring things out. Better to say nothing than to guess. Similarly, if you've told Chat how to do something, it can be smart to ask it to create a skill. But, asking an AI to write a skill in a topic where you're not an epxpert is a recipe for disaster, as you can encode errors that are just repeated forever.
Give precise instructions
Consider the following skill, which at first glance seems straightforward.
1. Duplicate the data.2. Split it, with one variable for each column.3. Remove the brand referenced in each of the Variable Labels.
1. Duplicate the selected variable set or ask the user to specify which variable set to use.2. Ensure the variable set has a Structure of Binary-Grid.3. Split it into separate Binary - Multi variable sets, with one set for each column.4. Remove the brand referenced from each of the Variable Labels in each of the variable sets that were just created, so that all that's left is the attribute. For example: "Coca-Cola: Good value for money" → "Good value for money"
Refer to options in the grapical user interface
Consider a skill that says Perform text categorization. Displayr has 101 different ways of doing this, so with such a request, you are leaving it to Displayr to work out which one to use.
However, the best feature for text categorization is typically the one that's obtained by selecting a text variable set in Data Sources and pressing + and then Text Categorization. We can tell a skill to follow this path by writing it like this: Use text categorization (Data Source > + > Text Categorization). An example is in Advanced Skills.
Use templates
Templates can be used to automate many things in Displayr, including charts, analyses, and whole sections of a report. It's usually better to create a template and have a skill use it (e.g., Apply the 'Purple Bar Chart.viz.QTemplate' template) than to get a skill to create a chart or analysis. Note that we need to show the whole file name, including the file extension - this can be seen in the Cloud Drive.
Use QScript for things that need to be done a lot
If you have a process that lots of people need to use and they need to use it a lot, it can be a good idea to "harden" by replacing parts of the skill with QScript. See the worked example in Advanced Skills.