File size: 1,339 Bytes
b136cbe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Your collected data: `data/your_study/`

If you deploy `survey_apps/main_study/` to collect new preferences, the
converted analysis tables go here. The published `data/main_study/` is
never modified.

```
your_study/
├── raw/
│   └── firebase_export.json    written by tools/export-firestore.js
└── *.csv                       written by the data-prep scripts
```

## Workflow

1. Export your Firestore project. Put a service-account key at
   `./service-account.json` (gitignored), then run:
   ```bash
   npm install
   node tools/export-firestore.js
   ```
   See `survey_apps/main_study/firebase_data_structure.md` for the
   document schema.

2. Build the stimulus tables from your `survey_data.json`, then convert
   the export:
   ```bash
   ANALYSIS_DATA_DIR=data/your_study python analysis/01_data_prep/01_build_stim_tables.py
   ANALYSIS_DATA_DIR=data/your_study python analysis/01_data_prep/02_convert_main_json_to_csv.py
   ```

3. Run any main-study analysis:
   ```bash
   ANALYSIS_DATA_DIR=data/your_study python analysis/02_main_study/01_omnibus_bias_model.py
   ```

The synthetic-rating tables (`synth_long_*`) are stimulus-level. If your
stimuli match ours, copy them from `data/main_study/`. Otherwise generate
your own and convert them with
`analysis/01_data_prep/03_synth_to_long_csv_multi.py`.