Analyze a specific participant's longitudinal passive-sensing and psychological data in the GLOBEM digital depression research dataset. Use this skill whenever the task involves: analyzing a user's mental health or behavioral data from wearables/smartphones, generating QA pairs about behavioral/psychological changes over time, working with EMA, depression scores, activity, sleep, communication, location, or phone-usage data, or any user-profile analysis in the DDR/GLOBEM context.
Analyze all available data for a specified participant (identified by pid, e.g., INS-W_011) and submit QA pairs covering their behavioral and psychological changes across the observation period. Aim for 15+ high-quality, distinct QA pairs covering every available data modality and multiple sub-dimensions within each modality.
Dataset Structure
All CSV files share the columns pid (participant ID) and date. Filter every file by the target pid.
Sensor files (92 days per participant, many NaN rows are normal):
activity_allday_raw.csv — daily step count, active/sedentary bout counts and durations
dep_endterm.csv — final depression label and BDI2 score
Schema tip: Use get_field_description(data_file="<filename>") for the six sensor CSV files. For ema.csv, dep_weekly.csv, pre.csv, post.csv, infer column meanings from names.
Known column pitfalls:
platform.csv uses column platform, not os
Home time: use barnett_hometime (not barnett_homelabel, which does not exist)
summary_rapids_* columns repeat the same period-wide value on every row — use intraday_rapids_* for daily variation
Analysis Workflow
1. Orient to the participant
import pandas as pd
pid = "INS-W_011" # replace with target
files = ["ema.csv", "dep_weekly.csv", "activity_allday_raw.csv",
"sleep_allday_raw.csv", "communication_allday_raw.csv",
"location_allday_raw.csv", "phone_usage_allday_raw.csv",
"connectivity_allday_raw.csv"]
for f in files:
df = pd.read_csv(f)
sub = df[df['pid'] == pid]
n_valid = sub.select_dtypes('number').notna().any(axis=1).sum()
print(f"{f}: {len(sub)} rows, {n_valid} with any numeric data")
2. Temporal segmentation for sensor data
Split the participant's non-NaN rows into early and late halves by date. This is the standard comparison unit for sensor modalities. Always dropna() on the target column first.
def early_late(df, pid, value_col):
sub = df[df['pid'] == pid].copy()
sub['date'] = pd.to_datetime(sub['date'])
sub = sub.sort_values('date').dropna(subset=[value_col])
mid = len(sub) // 2
early = sub.iloc[:mid][value_col].mean()
late = sub.iloc[mid:][value_col].mean()
return early, late
For each modality, also compute weekday vs weekend means — this often reveals additional QA-worthy patterns.
Count vs duration dissociation (more unlocks but shorter, or vice versa)
Connectivity
rapids_countscans, rapids_uniquedevices
—
Environmental exposure diversity
4. Extract richer sub-dimension insights
Weekday vs weekend: For every modality with ≥10 weekday and ≥5 weekend valid days, compute means separately. Report if the difference is >15%.
Active/sedentary ratio: Compute the ratio of active bout duration (or count) to sedentary bout duration (or count) for early vs late periods. Even a small change in ratio can be a meaningful QA pair.
Call count vs duration dissociation: If outgoing call count increases but total duration decreases (or vice versa), this is a notable pattern (more frequent but shorter calls, or fewer but longer calls).
Phone count vs duration dissociation: Similarly, if unlock count drops but total duration rises, the user is having fewer but longer phone sessions — worth a dedicated QA pair.
Location diversity: Extract doryab_locationentropy (or barnett_siglocentropy) and doryab_numberlocationtransitions for early vs late. An increase signals more spatially diverse behavior; a decrease signals more routine.
Circadian routine score (barnett_circdnrtn, 0=chaotic, 1=perfectly consistent): Changes here indicate shifts in daily routine regularity.
Temporal anomalies with specific dates: After weekly aggregation, identify anomaly weeks (>2× median distance). Then examine individual dates within that week to pinpoint peak travel days with exact dates and magnitudes.
sub['week'] = pd.to_datetime(sub['date']).dt.isocalendar().week
weekly = sub.groupby('week')['barnett_disttravelled'].mean()
anomaly_weeks = weekly[weekly > weekly.median() * 2]
# Then drill into those weeks for the top dates
for wk in anomaly_weeks.index:
wk_days = sub[sub['week'] == wk].nlargest(3, 'barnett_disttravelled')
print(wk_days[['date', 'barnett_disttravelled']])
EMA spike analysis: Identify the dates with highest negative affect and examine what behavioral signals coincide (travel events, reduced sleep, reduced home time). Report specific dates and values.
Event-day behavioral comparison: When a travel anomaly is detected, compare sleep, phone usage, and other metrics on those specific days vs participant's overall average. This produces high-value cross-modal QA pairs.
Cross-modal correlations: When two streams have ≥10 shared observations, compute Pearson correlation.
merged = pd.merge(df_comm[['date','rapids_incoming_count']],
df_loc[['date','barnett_disttravelled']], on='date')
r = merged[['rapids_incoming_count','barnett_disttravelled']].corr().iloc[0,1]
Self-report vs behavioral discrepancies: When survey direction contradicts behavioral signal (e.g., social support worsens in surveys but outgoing calls increase), surface that tension explicitly.
Behavioral trajectory vs psychological trajectory comparison: If behavioral metrics (calls, mobility, phone use) increase while psychological metrics worsen (or vice versa), name this dissociation as a meta-pattern QA pair.
5. Formulate and submit QA pairs
Each QA pair must:
Ask about a specific behavioral or psychological dimension with a clear time reference
Include concrete numbers in the answer (mean values, direction and magnitude of change, scale names)
Describe the direction and magnitude using natural language ("increased substantially", "remained stable", "decreased modestly")
Remain factual — do not over-interpret causation
Submit with: submit_qa_pair(q="...", a="...")
Good QA pair examples (structure to emulate):
Q: "How did the user's negative affect change over the observation period?" A: "It showed a moderate increase, rising from 8.44 in the early period to 10.56 in the later period."
Q: "How did the user's physical activity levels and sedentary behavior change between early and late periods?" A: "Physical activity decreased modestly (steps: 10,884→9,249/day; -15%). Sedentary bout duration increased slightly while active bout duration fell, shifting the active-to-sedentary ratio from 0.19 to 0.16."
Q: "How did outgoing call frequency and duration change between early and late periods?" A: "Outgoing calls increased from 1.24 to 3.67/day (+196%), but total duration increased more dramatically (from 58s to 305s mean/call), suggesting fewer but much longer conversations in the later period."
Q: "How did the user's mobility and phone usage differ between weekdays and weekends?" A: "Weekend distance traveled averaged 162 km vs 23 km on weekdays, with home time decreasing by 2.2 hours. Phone usage also increased modestly on weekends (+4 unlocks/day)."
Q: "Was there any exceptional mobility event during the study?" A: "Week 24 showed exceptional mobility with distance spiking to 176,804 m — approximately 5× the participant's median. Peak travel days occurred on May 24 (4.4M m) and May 27 (3.98M m), suggesting major long-distance travel."
Q: "Did the user's peak negative affect episodes coincide with any specific behavioral events?" A: "Yes, the two highest negative affect days (May 20: 5.0, May 24: 8.0) coincided with the largest travel days (641 km and 4,428 km), suggesting travel-related stress during the high-mobility period."
Q: "How did the user's spatial behavior and routine patterns change between early and late periods?" A: "Location entropy decreased from 0.28 to 0.21 nats suggesting less diverse location usage, circadian routine weakened from 0.62 to 0.50 indicating less consistent daily patterns, while location transitions increased from 2.34 to 5.00/day."
Q: "Is there a discrepancy between self-reported social support and behavioral communication patterns?" A: "Yes: self-reported emotional social support decreased (giving: 14→8, receiving: 20→14), yet outgoing calls increased from 9.25 to 13.92/day, suggesting behavioral social engagement increased despite perceived support decline."
6. QA coverage checklist
Aim to cover all of these (skip only if data is entirely NaN):
EMA negative affect trajectory (early/late)
EMA spike analysis — specific high-affect dates and coinciding behaviors
Weekly depression status and severity (including BDI2 endterm)
Weekly depression/anxiety subscale trajectory
Pre-post psychological state (depression, anxiety/stress)
Pre-post social factors (loneliness, social support, social fit)
barnett_homelabel does not exist — use barnett_hometime for Barnett-algorithm home time.
platform.csv column is platform, not os — KeyError on os is a common bug.
Submit QA pairs incrementally as you finish each modality — don't batch them all at the end.
Communication data is often sparse (<30% valid days for some participants) — note this limitation but still extract the available patterns.
Distance outliers: filter values >10× median before computing means for location data to avoid skew from extreme travel days inflating averages.
1---2name: ddr-globem-analysis3description: Analyze a specific participant's longitudinal passive-sensing and psychological data in the GLOBEM digital depression research dataset. Use this skill whenever the task involves: analyzing a user's mental health or behavioral data from wearables/smartphones, generating QA pairs about behavioral/psychological changes over time, working with EMA, depression scores, activity, sleep, communication, location, or phone-usage data, or any user-profile analysis in the DDR/GLOBEM context.4---56# DDR GLOBEM Participant Analysis78## Task Overview910Analyze all available data for a specified participant (identified by `pid`, e.g., `INS-W_011`) and submit QA pairs covering their behavioral and psychological changes across the observation period. Aim for **15+ high-quality, distinct QA pairs** covering every available data modality and multiple sub-dimensions within each modality.1112## Dataset Structure1314All CSV files share the columns `pid` (participant ID) and `date`. Filter every file by the target `pid`.1516**Sensor files** (92 days per participant, many NaN rows are normal):17- `activity_allday_raw.csv` — daily step count, active/sedentary bout counts and durations18- `sleep_allday_raw.csv` — sleep duration (minutes), efficiency, bedtime/wake-time19- `communication_allday_raw.csv` — incoming/outgoing/missed call counts, durations, distinct contacts20- `location_allday_raw.csv` — distance traveled, radius of gyration, home time, significant places, circadian routine, location entropy, location transitions21- `phone_usage_allday_raw.csv` — unlock episode count, total duration, average duration per episode22- `connectivity_allday_raw.csv` — Bluetooth scan count, unique devices2324**Assessment files** (one row per observation per participant):25- `ema.csv` — `negative_affect_EMA` score, timestamped across the study period26- `dep_weekly.csv` — weekly `feel_anxious`, `feel_depressed`, `BDI2` (endterm only), `dep` (binary), `dep_weekly_subscale`, `anx_weekly_subscale`27- `pre.csv` / `post.csv` — baseline vs. end-of-study psychological scales (loneliness, perceived stress, anxiety, depression, social support, emotion regulation, resilience, mindfulness, coping)28- `dep_endterm.csv` — final depression label and BDI2 score2930**Schema tip**: Use `get_field_description(data_file="<filename>")` for the six sensor CSV files. For `ema.csv`, `dep_weekly.csv`, `pre.csv`, `post.csv`, infer column meanings from names.3132**Known column pitfalls**:33- `platform.csv` uses column `platform`, not `os`34- Home time: use `barnett_hometime` (not `barnett_homelabel`, which does not exist)35- `summary_rapids_*` columns repeat the same period-wide value on every row — use `intraday_rapids_*` for daily variation3637## Analysis Workflow3839### 1. Orient to the participant4041```python42import pandas as pd4344pid = "INS-W_011" # replace with target45files = ["ema.csv", "dep_weekly.csv", "activity_allday_raw.csv",46 "sleep_allday_raw.csv", "communication_allday_raw.csv",47 "location_allday_raw.csv", "phone_usage_allday_raw.csv",48 "connectivity_allday_raw.csv"]49for f in files:50 df = pd.read_csv(f)51 sub = df[df['pid'] == pid]52 n_valid = sub.select_dtypes('number').notna().any(axis=1).sum()53 print(f"{f}: {len(sub)} rows, {n_valid} with any numeric data")54```5556### 2. Temporal segmentation for sensor data5758Split the participant's non-NaN rows into early and late halves by date. This is the standard comparison unit for sensor modalities. Always `dropna()` on the target column first.5960```python61def early_late(df, pid, value_col):62 sub = df[df['pid'] == pid].copy()63 sub['date'] = pd.to_datetime(sub['date'])64 sub = sub.sort_values('date').dropna(subset=[value_col])65 mid = len(sub) // 266 early = sub.iloc[:mid][value_col].mean()67 late = sub.iloc[mid:][value_col].mean()68 return early, late69```7071For each modality, also compute **weekday vs weekend** means — this often reveals additional QA-worthy patterns.7273```python74sub['dayofweek'] = pd.to_datetime(sub['date']).dt.dayofweek75weekday = sub[sub['dayofweek'] < 5][value_col].mean()76weekend = sub[sub['dayofweek'] >= 5][value_col].mean()77```7879### 3. Data to extract per modality8081| Modality | Primary columns | Secondary columns (also extract) | QA angles |82|---|---|---|---|83| EMA | `negative_affect_EMA` | — | Early/late trend; spike timing with specific dates |84| Weekly depression | `feel_depressed`, `feel_anxious`, `dep`, `BDI2` | `dep_weekly_subscale`, `anx_weekly_subscale` | Persistent depression; symptom trajectory; final severity |85| Pre/Post surveys | All `_PRE` / `_POST` pairs | — | Change in loneliness, stress, anxiety, depression, social support, emotion regulation, resilience, coping, mindfulness |86| Activity | `intraday_rapids_sumsteps` | `intraday_rapids_sumdurationactivebout`, `intraday_rapids_sumdurationsedentarybout`, bout counts | Steps change; sedentary/active bout ratio change |87| Sleep | `summary_rapids_sumdurationasleepmain` (primary), `summary_rapids_avgefficiencymain` | `summary_rapids_firstbedtimemain`, `summary_rapids_lastwaketimemain` | Duration, quality, timing changes |88| Communication | `rapids_outgoing_count`, `rapids_incoming_count`, `rapids_missed_count` | `rapids_outgoing_sumduration`, `rapids_outgoing_distinctcontacts` | Call count vs duration dissociation; proactive vs reactive patterns |89| Location | `barnett_disttravelled`, `barnett_rog`, `barnett_hometime` | `barnett_circdnrtn` (circadian routine 0–1), `doryab_locationentropy` or `barnett_siglocentropy`, `doryab_numberlocationtransitions`, `barnett_siglocsvisited` | Mobility, home-time, spatial diversity, routine consistency, location transitions |90| Phone usage | `rapids_countepisodeunlock`, `rapids_sumdurationunlock` | `rapids_avgdurationunlock` | Count vs duration dissociation (more unlocks but shorter, or vice versa) |91| Connectivity | `rapids_countscans`, `rapids_uniquedevices` | — | Environmental exposure diversity |9293### 4. Extract richer sub-dimension insights9495**Weekday vs weekend**: For every modality with ≥10 weekday and ≥5 weekend valid days, compute means separately. Report if the difference is >15%.9697**Active/sedentary ratio**: Compute the ratio of active bout duration (or count) to sedentary bout duration (or count) for early vs late periods. Even a small change in ratio can be a meaningful QA pair.9899**Call count vs duration dissociation**: If outgoing call count increases but total duration decreases (or vice versa), this is a notable pattern (more frequent but shorter calls, or fewer but longer calls).100101**Phone count vs duration dissociation**: Similarly, if unlock count drops but total duration rises, the user is having fewer but longer phone sessions — worth a dedicated QA pair.102103**Location diversity**: Extract `doryab_locationentropy` (or `barnett_siglocentropy`) and `doryab_numberlocationtransitions` for early vs late. An increase signals more spatially diverse behavior; a decrease signals more routine.104105**Circadian routine score** (`barnett_circdnrtn`, 0=chaotic, 1=perfectly consistent): Changes here indicate shifts in daily routine regularity.106107**Temporal anomalies with specific dates**: After weekly aggregation, identify anomaly weeks (>2× median distance). Then examine individual dates within that week to pinpoint peak travel days with exact dates and magnitudes.108109```python110sub['week'] = pd.to_datetime(sub['date']).dt.isocalendar().week111weekly = sub.groupby('week')['barnett_disttravelled'].mean()112anomaly_weeks = weekly[weekly > weekly.median() * 2]113# Then drill into those weeks for the top dates114for wk in anomaly_weeks.index:115 wk_days = sub[sub['week'] == wk].nlargest(3, 'barnett_disttravelled')116 print(wk_days[['date', 'barnett_disttravelled']])117```118119**EMA spike analysis**: Identify the dates with highest negative affect and examine what behavioral signals coincide (travel events, reduced sleep, reduced home time). Report specific dates and values.120121**Event-day behavioral comparison**: When a travel anomaly is detected, compare sleep, phone usage, and other metrics on those specific days vs participant's overall average. This produces high-value cross-modal QA pairs.122123**Cross-modal correlations**: When two streams have ≥10 shared observations, compute Pearson correlation.124125```python126merged = pd.merge(df_comm[['date','rapids_incoming_count']],127 df_loc[['date','barnett_disttravelled']], on='date')128r = merged[['rapids_incoming_count','barnett_disttravelled']].corr().iloc[0,1]129```130131**Self-report vs behavioral discrepancies**: When survey direction contradicts behavioral signal (e.g., social support worsens in surveys but outgoing calls increase), surface that tension explicitly.132133**Behavioral trajectory vs psychological trajectory comparison**: If behavioral metrics (calls, mobility, phone use) increase while psychological metrics worsen (or vice versa), name this dissociation as a meta-pattern QA pair.134135### 5. Formulate and submit QA pairs136137Each QA pair must:138- Ask about a **specific behavioral or psychological dimension** with a clear time reference139- Include **concrete numbers** in the answer (mean values, direction and magnitude of change, scale names)140- Describe the **direction and magnitude** using natural language ("increased substantially", "remained stable", "decreased modestly")141- Remain factual — do not over-interpret causation142143Submit with: `submit_qa_pair(q="...", a="...")`144145**Good QA pair examples** (structure to emulate):146147- Q: "How did the user's negative affect change over the observation period?" 148 A: "It showed a moderate increase, rising from 8.44 in the early period to 10.56 in the later period."149150- Q: "How did the user's physical activity levels and sedentary behavior change between early and late periods?" 151 A: "Physical activity decreased modestly (steps: 10,884→9,249/day; -15%). Sedentary bout duration increased slightly while active bout duration fell, shifting the active-to-sedentary ratio from 0.19 to 0.16."152153- Q: "How did outgoing call frequency and duration change between early and late periods?" 154 A: "Outgoing calls increased from 1.24 to 3.67/day (+196%), but total duration increased more dramatically (from 58s to 305s mean/call), suggesting fewer but much longer conversations in the later period."155156- Q: "How did the user's mobility and phone usage differ between weekdays and weekends?" 157 A: "Weekend distance traveled averaged 162 km vs 23 km on weekdays, with home time decreasing by 2.2 hours. Phone usage also increased modestly on weekends (+4 unlocks/day)."158159- Q: "Was there any exceptional mobility event during the study?" 160 A: "Week 24 showed exceptional mobility with distance spiking to 176,804 m — approximately 5× the participant's median. Peak travel days occurred on May 24 (4.4M m) and May 27 (3.98M m), suggesting major long-distance travel."161162- Q: "Did the user's peak negative affect episodes coincide with any specific behavioral events?" 163 A: "Yes, the two highest negative affect days (May 20: 5.0, May 24: 8.0) coincided with the largest travel days (641 km and 4,428 km), suggesting travel-related stress during the high-mobility period."164165- Q: "How did the user's spatial behavior and routine patterns change between early and late periods?" 166 A: "Location entropy decreased from 0.28 to 0.21 nats suggesting less diverse location usage, circadian routine weakened from 0.62 to 0.50 indicating less consistent daily patterns, while location transitions increased from 2.34 to 5.00/day."167168- Q: "Is there a discrepancy between self-reported social support and behavioral communication patterns?" 169 A: "Yes: self-reported emotional social support decreased (giving: 14→8, receiving: 20→14), yet outgoing calls increased from 9.25 to 13.92/day, suggesting behavioral social engagement increased despite perceived support decline."170171### 6. QA coverage checklist172173Aim to cover all of these (skip only if data is entirely NaN):174- [ ] EMA negative affect trajectory (early/late)175- [ ] EMA spike analysis — specific high-affect dates and coinciding behaviors176- [ ] Weekly depression status and severity (including BDI2 endterm)177- [ ] Weekly depression/anxiety subscale trajectory178- [ ] Pre-post psychological state (depression, anxiety/stress)179- [ ] Pre-post social factors (loneliness, social support, social fit)180- [ ] Pre-post emotion regulation / coping / resilience / mindfulness181- [ ] Physical activity (steps) early vs. late182- [ ] Activity/sedentary bout ratio or absolute bout duration early vs. late183- [ ] Sleep duration and quality early vs. late184- [ ] Weekday vs weekend differences (at least one modality where difference is notable)185- [ ] Communication patterns — call count AND duration/contacts early vs. late; note count/duration dissociation if present186- [ ] Mobility patterns (distance, RoG, home time) early vs. late187- [ ] Location diversity (entropy, circadian routine score, significant places, location transitions) early vs. late188- [ ] Phone usage behavior (unlock count AND duration) early vs. late; note dissociation if present189- [ ] Connectivity / environmental exposure early vs. late190- [ ] Temporal anomaly (if detected) — with specific dates, magnitudes, and what else coincided191- [ ] Cross-modal correlation (if data permits, ≥10 shared observations)192- [ ] Self-report vs. behavioral discrepancy (if present)193- [ ] Behavioral trajectory vs. psychological trajectory dissociation (if behavioral and psychological trends diverge)194195## Common Pitfalls196197- **Never split raw 92-row arrays** — many rows will be NaN. Always `dropna()` on the target column before computing early/late statistics.198- **`summary_rapids_*` columns are period-wide summaries** — they repeat the same value across all rows. Use `intraday_rapids_*` for genuine daily variation.199- **`get_field_description` won't work for `ema.csv` or `dep_weekly.csv`** — infer column meanings from names.200- **BDI2 appears in `dep_weekly.csv` only in the final row** — it's the endterm score, not a weekly measure.201- **Pre/post survey scale directions vary**: higher UCLA = more loneliness (bad), higher ERQ_reappraisal = better regulation (good), higher PSS = more stress (bad), higher BRS = better resilience (good).202- **`barnett_homelabel` does not exist** — use `barnett_hometime` for Barnett-algorithm home time.203- **`platform.csv` column is `platform`, not `os`** — KeyError on `os` is a common bug.204- **Submit QA pairs incrementally** as you finish each modality — don't batch them all at the end.205- **Communication data is often sparse** (<30% valid days for some participants) — note this limitation but still extract the available patterns.206- **Distance outliers**: filter values >10× median before computing means for location data to avoid skew from extreme travel days inflating averages.
Run npx skillmds@latest add zjunlp/ddr-globem-analysis in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Analyze a specific participant's longitudinal passive-sensing and psychological data in the GLOBEM digital depression research dataset. Use this skill whenever the task involves: analyzing a user's mental health or behavioral data from wearables/smartphones, generating QA pairs about behavioral/psychological changes over time, working with EMA, depression scores, activity, sleep, communication, location, or phone-usage data, or any user-profile analysis in the DDR/GLOBEM context. It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
zjunlp (@zjunlp) published this skill. Their other Agent Skills are listed on their SkillMD profile.