Skip to main content

A package that transform intermediate log files into features of interest for analysis

Project description

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


  1. This project has been wrapped up as a Pypi package. Use pip to install.
  2. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microt_prompt-0.1.22.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microt_prompt-0.1.22-py3-none-any.whl (69.2 kB view details)

Uploaded Python 3

File details

Details for the file microt_prompt-0.1.22.tar.gz.

File metadata

  • Download URL: microt_prompt-0.1.22.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.0

File hashes

Hashes for microt_prompt-0.1.22.tar.gz
Algorithm Hash digest
SHA256 066b26b308cc428862ae74dbc4195698298bfa32a08df5dd813b97f9671b16b4
MD5 e4eb19e2d389308bbfe4c408959dcf48
BLAKE2b-256 c8b29c5bfeafa9da866cebcb50aea1e44e3b2c6966c6f3ab495556b5bc467fd3

See more details on using hashes here.

File details

Details for the file microt_prompt-0.1.22-py3-none-any.whl.

File metadata

  • Download URL: microt_prompt-0.1.22-py3-none-any.whl
  • Upload date:
  • Size: 69.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.10.0

File hashes

Hashes for microt_prompt-0.1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 6142481d72bd6cbc5a5863dceaee4cfe554000c97c270672a658a65073d06dda
MD5 3ef58324da33ac9c7481fbe7bfd87f01
BLAKE2b-256 edf30b7e0a0fdfd22a2522d77fab1e7ce76556d820b12cf4ae560fcb408f0213

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page