# Codebook

De-identified data for the inflation-expectations × GenAI-chat studies. One row per participant in `raw_study{1,2,3}.csv`; one row per chat message in `chat_study{1,2,3}.csv`. The `prolific_id` column has been dropped; `id` (a random UUID) is the only identifier. The numeric suffix in each filename is the corresponding AsPredicted study identifier.

## Task flow (all studies)
Participant gives an **initial** 12-month inflation forecast (+ explanation) → is paired with a GenAI chatbot and discusses → gives a **revised** forecast (+ reasoning). The chatbot's persuasive style is set by `treatment`. Study 3 adds a 7-bar **uncertainty distribution** elicited before and after the chat.

## `raw_study{1,2,3}.csv` — shared variables

| Column | Type | Description |
|---|---|---|
| `id` | UUID | Unique response identifier (the only identifier; replaces `prolific_id`). |
| `treatment` | text | Condition assignment — see **Conditions** below. |
| `initial_forecast` | numeric | Pre-chat 12-month CPI inflation forecast (percent). |
| `forecast_explanation` | text | Free-text rationale for the initial forecast. |
| `information_sources` | text | Self-reported sources used to form the forecast. |
| `revised_forecast` | numeric | Post-chat forecast (percent). |
| `revision_reasoning` | text | Free-text rationale for any revision. |
| `age` | int | Self-reported age. |
| `education` | text | Highest education level. |
| `economic_familiarity` | ordinal | Self-rated familiarity with economics. |
| `current_events_frequency` | ordinal | How often the participant follows current events. |
| `inflation_concern` | ordinal | Self-rated concern about inflation. |
| `political_orientation` | ordinal | Liberal–conservative self-placement. |
| `party_affiliation` | text | Party identification. |
| `session_id` | UUID | Chat session; foreign key to `chat_study*.csv.session_id`. |
| `completed` | bool | Reached the end of the study. |
| `pair_status` | text | GenAI-pairing outcome; `AI_PAIR_SUCCESS` = successfully matched (Study-3 inclusion criterion). |
| `discussion_started_at`, `discussion_ended_at` | timestamp | Chat window bounds. |
| `starttime`, `endtime` | timestamp | Survey session bounds. |
| `comments` | text | Optional end-of-study open comment. |
| `encountered_issues` | bool | Participant flagged a technical problem. |
| `issues_description` | text | Free-text description of any technical problem. |

## Study-specific additions

**Study 2 & 3** — five binary "optimized-message" factor flags (the levers the GenAI used in the `factors`/optimized arm):
`factor_length`, `factor_certainty`, `factor_information`, `factor_questions`, `factor_attitude`.

**Study 3 only** — pre/post forecast-uncertainty distributions, stored as JSON over 7 bins
(`ltm2, m2_0, 0_2, 2_4, 4_6, 6_8, gt8`; bin probabilities/weights):
`uncertainty_initial`, `uncertainty_revised`. `R/_helpers.R::dist_sd()` converts each to an SD (pp) using bin midpoints `-3,-1,1,3,5,7,9`.

## Conditions (`treatment`)

| Study | Values | Notes |
|---|---|---|
| 1 | `ai-chat`, `ai-nochat`, `chat`, `nochat` | Chat × AI-partner design. |
| 2 | `factors` only | Factor-only (optimized) build; no control in the launch cohort by design. |
| 3 | `unrelated`, `baseline`, `factors` | Mapped in analysis to **Control** (`unrelated`), **Baseline**, **Optimized** (`factors`); Control is the regression reference. |

**AI respondent rows.** Studies 1 and 3 include the AI chatbot's own rows (`id` begins `AI-`; flagged `is_ai` in the cleaned data) — Study 1: 874, Study 3: 1,256. They carry the AI's data for that session, including the selected news sources (`information_sources`) and the opening argument (`forecast_explanation`). They are kept in the raw and cleaned data but **excluded from every reported analysis** — the manuscript analysis restricts to real participants (Study 1 also uses them as session partners for Weight-on-Advice).

**Study 2 has no AI rows.** That build kept the AI participant virtual rather than storing it as a participant row, so only the AI's chat turns were recorded. The Study 2 AI's opening argument (with its forecast stated in prose) lives in `chat_study2.csv` (sender id begins `AI-`).

## `chat_study{1,2,3}.csv`

| Column | Type | Description |
|---|---|---|
| `id` | int/UUID | Message row id. |
| `session_id` | UUID | Joins to `raw_study*.session_id`. |
| `participant_id` | text | Sender; a participant `id` or an `AI-…` id for chatbot turns. |
| `recipient_id` | text | Recipient id. |
| `message` | text | Message body. |
| `timestamp` | timestamp | Send time. |

## Derived variables (added by `R/clean_study*.R`)

All cleaned files add `is_ai` (logical; TRUE for AI respondent rows) and `completed_flag`. The remaining variables below are Study 3 (`R/clean_study3.R`):

| Variable | Description |
|---|---|
| `is_ai` | TRUE for AI respondent rows (`id` begins `AI-`); analyses keep only `is_ai == FALSE`. |
| `condition` | factor Control / Baseline / Optimized (reference = Control). |
| `Baseline`, `Optimized` | 0/1 treatment dummies. |
| `initial`, `revised` | numeric forecasts. |
| `genai` | GenAI's displayed estimate = `initial + 3·sign(2.9 − initial)` (fixed 3 pp toward the 2.9 consensus). |
| `woa` | **Weight on Advice** = `(revised − initial) / (genai − initial)`; NA when `initial == 2.9`. |
| `dist` | `|initial − 2.9|` (distance of the initial forecast from consensus). |
| `sd_pre`, `sd_post` | SD (pp) of the pre/post uncertainty distributions. |
