anonymous-submission-acl2025's picture
add 17
8a79f2e

data

This module contains all code that preps for analysis and produces survey management deliverables (e.g. contact lists). The dataset needed to run this module rely on confidential data, and were thus omitted from this replication archive.

We detail how, in the presence of the raw confidential data, this module construct the main datasets.

1. Pipeline overview

We run the whole data pipeline by calling data/make.py, which will call run 3 main sub modules below. Note: many classes and functions required in this pipeline are located in lib/data_helpers.

 1. source/build_master
    
    a. Purpose: a builder object ( in builder.py) will pull all the raw data, detect gaming, clean each individual data files, merge them
     on the user level and the user_day_app level. 
    
    b. Input:
        i. Raw Survey
        ii. Phone Dashboard
        
    c. Output: 
        i. master_raw_user.pickle, a raw master file on the user level, that will contain data from surveys and PD data for each phase
        ii. master_user_day_app.pickle, a clean master file on the user day app level that will contain use, limit, and snooze activity
    
 2. source/clean_master
    
    a. Purpose: a cleaner object (in cleaner.py) will clean the raw_master_user.pickle, and assign treatments, calculate earnings, 
    and create outcome variables
    
    b. Input: raw_master_user.pickle
    
    c. Output: clean_master_user.pickle
    
 3. source/exporters
    
    a. Purpose: creates contact lists, tango cards, phone dashboard treatment configs, and analysis files ready for stata
    
    b. Input: master_clean_user.pickle and master_user_day_app.pickle
    
    c. Output: 
      i. Contact Lists, Tango Cards, Phone Dashboard, Treatment Configs, and other data with identifiable info will output into /Dropbox/PhoneAddiction/Confidential
      ii. pre_analysis_user.csv and pre_analysis_user_app_day.csv in /Dropbox/PhoneAddiction/Data/{experiment_name}/Intermediate

2. Configurations:

 - root/config_user.yaml: configurations that alter how the pipeline is run. Read through those in the yaml file, but to highlight:
    1. skip_building: if true, data/run will start by reading in the latest raw master data file, instead of processing raw phone dashboard data. You should not attempt run the raw PD data unless you're on Sherlock or some HPC
    2. test: if set true, this runs nearly the full pipeline, but with dummy data. Data is saved in DataTest and ConfidentialTest. This is helpful when testing something in the build class
 
 - root/config.yaml: sets significant experiment dates (survey dates, and date range of PD data pull)
 
 - root/lib/experiment_specs: contains detailed specs for the data pipeline. Check out the README in that folder for specifics.
 

3. Raw Phone Dashboard Data Exports

  • All PD Data arrives in the PhonedashboardPort dropbox folder. All these files are processed by functions in data/source/build_master/builder.py and helper functions in lib/data_helpers

Snooze Events

1. PD receives usage ping from ForegroundApplication generator.

2. If app usage is within X minutes of budget being exhausted:

        2.a: PD does not block app, but launches warning activity with the package and metadata.

        2.b: Warning activity throws up warning dialog (event = app-block-warning).

        2.c: User closes / cancels dialog (event = closed-warning).

3. If app usage is past budget AND has been snoozed, and snooze delay has not elapsed:

        3.a: PD blocks app (returns system to the home screen (event = blocked_app).

        3.b: PD shows dialog letting user know that delay hasn’t elapsed (event = app-blocked-no-snooze).

        3.c: User closes/cancels dialog (event = app-blocked-no-snooze-closed).

3. If app usage is past budget AND app has not been snoozed:

        3.a: PD blocks app (returns system to the home screen (event = blocked_app).

        3.b: PD shows dialog letting user budget is exhausted (event = app-blocked-no-snooze).

        3.c: If snooze is NOT enabled for user:

                3.c.1: PD shows dialog that user cannot use app until tomorrow (event = app-blocked-no-snooze).

                3.c.2: User closes / cancels dialog (event = app-blocked-no-snooze-closed).

        3.d: If snooze IS enabled for user:

                3.d.1: PD shows dialog letting user know budget is up (event = app-blocked-can-snooze).

                3.d.2: If user closes / cancels dialog (event = skipped-snooze).

                3.d.3: If user decides to snooze, PD shows dialog asking about snooze amount (no event generated).

                        3.d.3.a: User closes / cancels snooze dialog, without setting limit (event = cancelled-snooze).

                        3.d.3.b: User sets snooze amount (event = snoozed-app-limit).