Introduction
This repository include Python scripts that transform raw sensor data collected from Android mobile devices into features of interest for analysis.
Current research topic: identify contextual prompt-level factors that predict response or no response in microEMA.
Statistical methodology: multi-level modeling
Outcomes: compliance rate
Predictors:
-
Within-person or prompt level:
- time of the day
- day of the week
- day in study
- activity level
- battery level
- location
-
Between-person or person level
- age
- gender
- study mode
Exploratory Discussions on Factors
Detailed discussions on factors can be found here.
Features Overview
Smartphone
| Outcome | Variable Type | Data Source |
|---|---|---|
| Answer Status | Categorical (Completed, CompletedThenDismissed, PartiallyCompleted, Started/NeverStarted, NeverPrompted, OverwrittenByDaily) | ./logs/PromptResponses.log.csv |
| Feature | Level | Effect Type | Variable Type | Data Source |
|---|---|---|---|---|
| Day of the Week | Level 1 (Within-person or prompt level) | Random | Categorical (Mon-Sat: 0-6) | ./logs/.../PromptResponses.log.csv |
| Time of the Day | Level 1 (Within-person or prompt level) | Random | Categorical (morning, afternoon, evening/night) | ./logs/.../PromptResponses.log.csv |
| Days in Study | Level 1 (Within-person or prompt level) | Random | Numeric (numeric value of day from the first day) | ./logs (start from the first date of created folder) |
| Battery Level | Level 1 (Within-person or prompt level) | Random | Numeric (Battery%) | ./data/.../Battery.##.event.csv |
| Charging Status | Level 1 (Within-person or prompt level) | Random | Binary (True/False) | ./data/.../Battery.##.event.csv |
| Location (LOC) | Level 1 (Within-person or prompt level) | Random | [Latitude, Longitude] | ./data/.../GPS.csv |
| Phone Lock | Level 1 (Within-person or prompt level) | Random | Binary (Phone Locked/Phone Unlocked) | ./data/.../AppEventCounts.csv |
| Last Phone Usage Duration | Level 1 (Within-person or prompt level) | Random | Numeric (minutes) | ./data/.../AppEventCounts.csv |
| Screen Status | Level 1 (Within-person or prompt level) | Random | Binary (Screen On/Screen Off) | ./logs/.../SystemBroadcastReceiver.csv |
| Wake/Sleep Time | Level 1 (Within-person or prompt level) | Random | Local time (2021-01-01 06:30:00 CST) | daily report |
Smartwatch
| Outcome | Level | Effect Type | Variable Type | Data Source |
|---|---|---|---|---|
| Compliance Rate | Level 1 (Within-person or prompt level) | Random | Numeric | ./logs-watch/PromptResponses.log.csv |
| Level 2 (Between-person or person level) | Random |
| Feature | Level | Effect Type | Variable Type | Data Source |
|---|---|---|---|---|
| Day of the Week | Level 1 (Within-person or prompt level) | Random | Categorical (Mon-Sat: 0-6) | ./logs-watch/.../PromptResponses.log.csv |
| Time of the Day | Level 1 (Within-person or prompt level) | Random | Categorical (morning, afternoon, evening/night) | ./logs-watch/.../PromptResponses.log.csv |
| Days in Study | Level 1 (Within-person or prompt level) | Random | Numeric (numeric value of day from the first day) | ./logs-watch (start from the first date of created folder) |
| Battery Level | Level 1 (Within-person or prompt level) | Random | Numeric (Battery%) | ./data-watch/.../Battery.##.event.csv |
| Location (LOC) | Level 1 (Within-person or prompt level) | Random | ||
| Activity Level (ACT) | Level 1 (Within-person or prompt level) | Random |
Code Usage for Feature Matrix Generation
- This project has been wrapped up as a Pypi package. Use pip to install.
- Clone this project and run locally.
#!python
python main_ema.py [intermediate_participant_path] [output_dir_path] [date_in_study] [decryption_password]
e.g., python main_ema.py G:...\intermediate_file\participant_id C:...\output_folder 2021-01-01 password
Special Notice
- Delete misc folder before running code, if new participants' intermediate folder has been created.
Release files for microt-compliance 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| microt_compliance-0.1.0.tar.gz | 34.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| microt_compliance-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 101.9 kB
Release files / microt_compliance-0.1.0.tar.gz
| Download URL | microt_compliance-0.1.0.tar.gz |
|---|---|
| Size | 34.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93fea811adff5e9d892003b477dac6faa460c4d496daf6f031a38a6a50f3c5d8
|
|
BLAKE2b-256 checksum How to use checksums |
cf0c5ac634214e834c618855752ab3c306ae7fe2883057273b164750849d55fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.1
|
Release files / microt_compliance-0.1.0-py3-none-any.whl
| Download URL | microt_compliance-0.1.0-py3-none-any.whl |
|---|---|
| Size | 67.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
050ea80e0b7e5441f01d5d1be2444f80290ba43a4426b0337634c6ebb36c8fc5
|
|
BLAKE2b-256 checksum How to use checksums |
26e10a4a0e22178edfff259eff1b7eb42557ea65a3339ea98d6f5f2aa820d6b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.1
|