Conjoint Analysis and Discrete Choice Tasks
Show annotators side-by-side profiles built from attribute levels, record the profile each one chooses, and keep the design for a choice model in R or Python.
The conjoint scheme shows an annotator two or more profiles side by side and records the profile the annotator would choose. Conjoint analysis is a survey technique that describes each option by a set of attributes, such as salary or commute time, and estimates from many choices how much each attribute level changes the choice. A choice-based conjoint, also called a discrete choice experiment, asks for one choice from each set of profiles rather than a rating of every profile. Potato draws and shows the profiles and records the choice together with the profiles shown. The choice model is fitted afterwards in R or Python.
When to use conjoint
Conjoint answers questions about trade-offs, such as how much salary a job seeker gives up for remote work. The scheme fits policy and market research, preference studies over product configurations such as AI assistants, and any study whose options differ on several attributes at once. When the two options are whole items from your data, such as two model responses, pairwise comparison is the closer fit. Best-worst scaling ranks a pool of items without describing the items by attributes.
Configuration
A scheme built from attributes lists each attribute with its levels:
annotation_schemes:
- annotation_type: conjoint
name: job_choice
description: "Which job offer would you accept?"
profiles_per_set: 2
attributes:
- name: Salary
levels: ["$55,000", "$65,000", "$75,000"]
- name: Remote work
levels: ["None", "Two days a week", "Fully remote"]
- name: Commute
levels: ["15 minutes", "45 minutes"]
- name: Contract
levels: ["Permanent", "One-year renewable"]
show_none_option: trueThe example uses two profiles per set because two cards are quick to compare. The default is three.
| Option | Type | Default | Description |
|---|---|---|---|
profiles_per_set | integer | 3 | Profiles shown per choice set. Validation rejects a value below 2. |
attributes | list | none | Attributes, each with a name and a list of levels. Required unless profiles_field is set. |
show_none_option | boolean | true | Adds a "None of these" choice below the cards. |
profiles_field | string | none | An item field that holds ready-made profiles. When set, Potato shows the item's profiles instead of drawing new ones. |
Besides name, description, and the four options above, the scheme takes the keys every scheme shares, and the conjoint generator reads label_requirement and layout among those keys. A conjoint scheme with neither attributes nor profiles_field fails validation when the server starts. Each card is headed "Option 1", "Option 2", and so on, with a radio input labelled "Choose this" under the card's table of attribute levels. The item's own text shows above the scheme as usual. The data file can therefore carry the scenario each choice is made in.
Random profiles per annotator and item
For a scheme built from attributes, the server builds each profile by drawing one level of every attribute at random, with equal probability and independently across attributes. The draw is seeded from the annotator, the item, and the scheme name. Each annotator therefore sees a different design on each item, and a reloaded page shows the same cards. Potato keeps the profiles in one set distinct while the attributes allow enough combinations.
The server saves the first design an annotator sees on an item and shows the saved design on every later visit. Editing the levels in the middle of a study leaves the cards of an item already shown to an annotator unchanged for that annotator. Potato has no setting for excluding implausible combinations of levels or for balancing levels across a study. A design built elsewhere, such as an efficient or blocked design, goes in the data through profiles_field.
The cards need no randomize_order because the profiles themselves are drawn at random. Potato ignores randomize_order on a conjoint scheme and logs a warning. Before Potato 2.13.1, the browser picked each level from the length of the item ID and the attribute name. Items with IDs of the same length showed the same profiles, and a conjoint study collected on an earlier version has no record of the profiles each annotator saw.
Profiles from your data
With profiles_field, each item supplies its own list of profiles, and Potato shows the list to every annotator as given, in data order. Use profiles_field when the design comes from another tool, or when the profiles are real options rather than combinations of levels. The scheme names the field:
annotation_schemes:
- annotation_type: conjoint
name: platform
description: "Which platform would you rather use?"
profiles_field: profiles
profiles_per_set: 3Each item then carries a list of profiles under that field:
{"id": "task_01", "text": "Your lab needs somewhere to run an annotation study.", "profiles": [
{"Hosting": "Self-hosted", "Cost": "Free"},
{"Hosting": "Cloud", "Cost": "$20/mo"},
{"Hosting": "Hybrid", "Cost": "$8/mo"}
]}Without an attributes block, Potato builds the rows of every card from the keys the profiles use. Every card gets a row for every key in the set, and a profile that omits a key shows an em dash in that row. The rows therefore stay aligned across cards. Declaring attributes beside profiles_field limits the cards to the attributes you name, in the order you name them.
The data decides how many profiles each item has. An item with fewer profiles than profiles_per_set shows one card per profile. An item with more shows the first profiles_per_set profiles and tells the annotator, for example "Showing 3 of 5 options for this item." Set profiles_per_set to the largest set in your data. Potato records no design for a profiles_field scheme because the data file already holds the design.
The "None of these" option
The "None of these" choice sits below the cards and is on by default. Choosing "None of these" stores "none" in place of a card number. Set show_none_option: false for a forced-choice design, in which every annotator has to pick one of the profiles.
Stored answers and shown profiles
The answer is the number of the chosen card as a string, from "1" up, or "none". In an export record, the answer sits under the scheme name twice, once for the scheme and once for the scheme's single value:
"labels": {"job_choice": {"job_choice": "2"}}For a scheme built from attributes, the profiles the annotator saw are saved in <output_annotation_dir>/<annotator>/user_state.json, under instance_id_to_presentation_order, keyed by item and then by scheme name, in card order:
"instance_id_to_presentation_order": {
"job_01": {
"job_choice": [
{"Salary": "$65,000", "Remote work": "None", "Commute": "15 minutes", "Contract": "Permanent"},
{"Salary": "$55,000", "Remote work": "Fully remote", "Commute": "45 minutes", "Contract": "One-year renewable"}
]
}
}Card "2" is the second profile in the list. The records written by export_annotation_format carry the choice and leave out the profiles. Read the design from user_state.json.
Potato's agreement reports treat a conjoint answer as one nominal choice. With profiles drawn from attributes, two annotators' card 2 on the same item is usually two different profiles. Matching card numbers therefore do not mean matching preferences, and annotators are better compared through the fitted model.
Estimating attribute importance
Estimation happens outside Potato, in R or Python. Potato 2.14.0 computes no part-worths, no average marginal component effects (AMCEs), and no attribute importance. A part-worth is the utility a choice model assigns to one level of one attribute. An AMCE is the average change in the probability of choosing a profile when one attribute moves from a reference level to another level.
Part-worth and AMCE estimators both start from a long table with one row per profile shown. The script below builds that table from every annotator's user_state.json, with chosen set to 1 for the chosen card and 0 for the others:
import csv
import glob
import json
SCHEME = "job_choice"
rows = []
for path in glob.glob("annotation_output/*/user_state.json"):
with open(path) as f:
state = json.load(f)
shown = state.get("instance_id_to_presentation_order", {})
for item_id, labels in state.get("instance_id_to_label_to_value", {}).items():
choice = next((value for label, value in labels if label.get("schema") == SCHEME), None)
profiles = shown.get(item_id, {}).get(SCHEME)
if choice is None or not profiles:
continue
for card, profile in enumerate(profiles, start=1):
rows.append({"annotator": state["user_id"], "item": item_id, "card": card,
"chosen": int(choice == str(card)), **profile})
with open("conjoint_long.csv", "w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=list(rows[0]))
writer.writeheader()
writer.writerows(rows)A "None of these" answer gives every card in the set chosen = 0. Drop those sets, or model the opt-out as a separate alternative if your estimator supports one. In R, the cjoint package estimates AMCEs from a table in this shape, with chosen as the outcome and annotator as the respondent ID. In Python, ConditionalLogit in statsmodels fits a conditional logit over dummy-coded levels, with each annotator and item pair as one group.
Full example
The config below runs the job-offer study with two profiles per choice:
annotation_task_name: "Job Offer Conjoint"
task_dir: "."
data_files:
- "data/job_tasks.jsonl"
item_properties:
id_key: id
text_key: text
annotation_schemes:
- annotation_type: conjoint
name: job_choice
description: "Which job offer would you accept?"
profiles_per_set: 2
attributes:
- name: Salary
levels: ["$55,000", "$65,000", "$75,000"]
- name: Remote work
levels: ["None", "Two days a week", "Fully remote"]
- name: Commute
levels: ["15 minutes", "45 minutes"]
- name: Contract
levels: ["Permanent", "One-year renewable"]
show_none_option: true
output_annotation_dir: "annotation_output/"
export_annotation_format: jsonl
user_config:
allow_all_users: trueEach line of the data file is one choice task, and the text frames the choice:
{"id": "job_01", "text": "You are offered two jobs in your field. Which would you accept?"}
{"id": "job_02", "text": "Both offers below are for the same role at different companies. Which would you accept?"}
{"id": "job_03", "text": "You are moving cities and have two offers. Which would you accept?"}Start the server:
potato start config.yaml -p 8000Potato's repository carries a second example, an AI assistant preference study with three profiles per set, in examples/classification/conjoint/. From a checkout of the repository, potato start examples/classification/conjoint/config.yaml -p 8000 runs that study.
Further reading
- Survey Research Tools Compared - conjoint beside list experiments and vignettes, and how other survey tools handle each
- Survey research in Potato - Potato's survey features in one place
- Pairwise Comparison - a choice between two items from your data
- Best-Worst Scaling - ranking a pool of items by best and worst choices
- Export Formats - getting the choices out
For implementation details, see the source documentation.