Skip to main content

Configuring the notebook

Before running, you customize a few parameters directly inside the notebook cells. These are not terminal commands — you open the .ipynb file in VS Code or Jupyter, click into the relevant cell, and change the values in place.

How to edit a cell

  1. Open your chosen notebook (e.g. CI-DML_AftCollabHours_PQ.ipynb).
  2. Scroll to the cell noted below (cell numbers are indicated for each setting).
  3. Click into the cell and change the value.
  4. Don’t run the cell yet — review all parameters first, then run from the top.

1 · File paths — Cell 3 (Setup and Imports)

Update the data file path to match your CSV filename:

# Update this line to match your data file name
data_file_path = os.path.join(script_dir, '..', 'data', 'PersonQuery.csv')
# For example:
# data_file_path = os.path.join(script_dir, '..', 'data', 'MyCompany_PersonQuery_2025.csv')

In the same cell, update the output directory name:

# Replace [YOUR COMPANY] with your organization name
output_base_dir = os.path.join(script_dir, '..', 'output', 'Subgroup Analysis - [YOUR COMPANY]')
# e.g.
# output_base_dir = os.path.join(script_dir, '..', 'output', 'Subgroup Analysis - Contoso')

2 · Effect direction — Cell 3 (After-Hours & Engagement notebooks only)

In the After-Hours notebooks (CI-DML_AftCollabHours_*.ipynb) and the Engagement notebook, set which direction of effect to search for:

# Find subgroups with NEGATIVE (reductions) or POSITIVE (increases) effects
FIND_NEGATIVE_EFFECTS = True   # True = reductions, False = increases

This toggle does not exist in the External Collaboration notebooks.

Engagement notebook only — outcome variable & scale (Cell 4)

The Engagement notebook needs the ordinal survey outcome and its scale:

# Match OUTCOME_VAR to your Glint survey metric column name
OUTCOME_VAR = 'eSat'   # e.g. 'eSat', 'eNPS', etc.

# Match the scale to your survey's response range
OUTCOME_SCALE_MIN = 1   # Minimum value on the scale
OUTCOME_SCALE_MAX = 7   # Maximum value (e.g. 5, 7, 9, or 10)

OUTCOME_VAR must match the exact column name in your Person Query export. The scale parameters drive ceiling/floor diagnostics and the interpretation of effect magnitudes on the ordinal scale.

3 · Organizational attributes — Cell 7 (Variable Definitions)

Update these lists to match the column names in your data.

SUBGROUP_VARS — attributes for subgroup / heterogeneity analysis:

SUBGROUP_VARS = [
    'FunctionType',      # e.g. 'Function', 'Department', 'Division'
    'IsManager',         # usually consistent across organizations
    'LevelDesignation',  # e.g. 'Level', 'Grade', 'Band'
    'Organization'       # update to match your data
]

These variables are used both for person-level aggregation and to identify subgroups with heterogeneous effects. Include 2–4 key attributes you want to analyze.

Network & collaboration variable lists (usually consistent, but verify)
NETWORK_VARS = [
    'Internal_network_size',
    'External_network_size',
    'Strong_ties',
    'Diverse_ties'
]

COLLABORATION_VARS = [
    'Collaboration_hours',
    'Available_to_focus_hours',
    'Active_connected_hours',
    'Uninterrupted_hours'
]

4 · Date range filter — Cell 7

Match the period covered by your data:

start_date_str = '2025-03-01'  # your data's start date
end_date_str   = '2025-06-30'  # your data's end date

5 · Treatment & outcome — Cell 5 (usually no change)

These are typically standard, but verify they exist in your data:

For the Engagement notebook, the outcome is specified in the configuration cell (see section 2) rather than pre-defined.

Pre-flight checklist

Before you run

  • Data file is in the data/ folder
  • data_file_path matches your CSV filename exactly (case-sensitive)
  • output_base_dir has your organization name (optional but recommended)
  • Every variable in SUBGROUP_VARS exists in your dataset
  • FIND_NEGATIVE_EFFECTS is set appropriately (after-hours & engagement only)
  • (Engagement only) OUTCOME_VAR matches the survey column name
  • (Engagement only) OUTCOME_SCALE_MIN / OUTCOME_SCALE_MAX match the survey scale
Last updated: Jun 22, 2026 Edit this page on GitHub