From ef57103bac79faedfd498cfa56b5efb0dd608207 Mon Sep 17 00:00:00 2001 From: junos Date: Tue, 15 Mar 2022 13:41:33 +0100 Subject: [PATCH] Add questionnaire ID key. --- config.yaml | 4 ++ src/features/phone_esm/straw/preprocess.py | 52 ++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/config.yaml b/config.yaml index 92578437..5c774a6e 100644 --- a/config.yaml +++ b/config.yaml @@ -645,3 +645,7 @@ PARAMS_FOR_ANALYSIS: QUESTION_LIST: survey637813+question_text.csv FEATURES: [age, gender, startlanguage, demand, control, demand_control_ratio] CATEGORICAL_FEATURES: [gender] + + TARGET: + SCALE: [positive_affect, negative_affect] + diff --git a/src/features/phone_esm/straw/preprocess.py b/src/features/phone_esm/straw/preprocess.py index d6279d9c..cd99d906 100644 --- a/src/features/phone_esm/straw/preprocess.py +++ b/src/features/phone_esm/straw/preprocess.py @@ -17,6 +17,58 @@ ESM_TYPE = { "date": 11, } +QUESTIONNAIRE_IDS = { + "sleep_quality": 1, + "PANAS": { + "positive_affect": 8, + "negative_affect": 9 + }, + "job_content_questionnaire": { + "job_demand": 10, + "job_control": 11, + "supervisor_support": 12, + "coworker_support": 13, + }, + "PFITS": { + "supervisor": 14, + "coworkers": 15 + }, + "UWES": { + "vigor": 16, + "dedication": 17, + "absorption": 18 + }, + "COPE": { + "active": 19, + "support": 20, + "emotions": 21 + }, + "work_life_balance": { + "life_work": 22, + "work_life": 23 + }, + "recovery_experience": { + "detachment": 24, + "relaxation": 25 + }, + "symptoms": 26, + "stress_appraisal": { + "stressfulness_event": 87, + "threat": 88, + "challenge": 89, + "event_time": 90, + "event_duration": 91, + "event_work_related": 92, + "stressfulness_period": 93, + }, + "late_work": 94, + "work_hours": 95, + "left_work": 96, + "activities": 97, + "coffee_breaks": 98, + "at_work_yet": 99, +} + ESM_STATUS_ANSWERED = 2 GROUP_SESSIONS_BY = ["participant_id", "device_id", "esm_session"]