Instruments describe questions; data files have columns. Three things connect them: the column map of each dataset, the administrations in the study file, and the overrides that record how a study changed an item.
Column maps¶
Each dataset has a column map, maps/<dataset>.csv unless it shares one (below), with three columns:
column,instrument,item
pid,,
visit_date,,
ems_1_w2,example_mood,ems_1
ems_2_w2,example_mood,ems_2
ems_3_w2,example_mood,ems_3Each row names a column of the data file and the instrument and item it holds. Columns that are not items, such as the ID or a date, have an empty instrument and item. column_unmapped warns about columns of the data file the map does not list, and unmapped_item about items of an administered instrument that have no column.
A column that holds a score your lab already computed is mapped to score: and the score’s ID, for example score:ems_total; labcatalog then compares it with its own computation.
You rarely write a column map by hand. A codebook import writes it (see Add an Instrument), and the editor in the Codebook step of the Set up page can change it. Excel can open and save it; choose “CSV UTF-8” when saving.
One map for several datasets¶
Datasets whose files have the same columns, such as the waves of one file that holds every wave, can read one map. Name it with map on each dataset, without the folder or .csv:
datasets:
- {name: parent_w1, ..., path: data/parent_long.csv, wave_column: wave, map: parent}
- {name: parent_w2, ..., path: data/parent_long.csv, wave_column: wave, map: parent}Both read maps/parent.csv, and each is still checked against its own data and administrations. A fix that adds a row or takes one out changes the map for every dataset that reads it, and the Fix panel says which ones. Repeat a dataset gives the new dataset the same map while its columns are the same as the one it repeats, and writes it a map of its own when they are not.
Administrations¶
The study file says which instruments were given in which datasets:
study: mock_study
administrations:
- {instrument: example_parent_stress, datasets: [parent_w1, parent_w2, parent_w3], target: self}
- {instrument: example_child_sleep, datasets: [parent_w1, parent_w2, parent_w3], target: child}
- {instrument: example_mood, datasets: [child_w1, child_w2, child_w3], target: self}An administration can also set:
| Key | Meaning |
|---|---|
target | Who the instrument is about; one of vocab.targets. |
abbreviation | The name this study used for the instrument, when it differs. |
reversed_in_data | true when reverse-keyed items are already reversed in the data. |
overrides | Changes to single items (below). |
Overrides¶
Studies change instruments: an item is reworded for children, a response scale is shortened, an item is left out of one wave. An override records such a change without copying the instrument:
administrations:
- instrument: example_mood
datasets: [child_w1, child_w2, child_w3]
overrides:
- {item: ems_9, text: I had fun with other kids.}
- {item: ems_5, dataset: child_w1, dropped: true}| Key | Meaning |
|---|---|
item | The item it changes. |
dataset | Only this dataset; without it, every dataset of the administration. |
text | The wording used. |
response_set | Another response set of the instrument. |
dropped | true when the item was not asked. |
When several overrides apply to the same item, the later ones win.
Methods¶
The study file also describes how each modality’s data were collected and processed, in a paragraph or two that the Methods page and the Datasets page show:
methods:
questionnaire: |
Parents filled in their questionnaires online in the week after each visit.
eeg: |
Resting EEG was recorded for five minutes with eyes closed from a 32-channel cap.