Skip to main content

AAT Analysis

This package helps with analyzing mobile AAT data.

Install

pip install aat_analysis

How to use

#%run utils.ipynb # Some utility functions
#%run make_condition_templates.ipynb # Defines expected data based on resources
#%run json_to_df.ipynb # Turns raw json data into dataframes and calculates responses, rts, and force
from aat_analysis.make_condition_templates import make_condition_templates
from aat_analysis.json_to_df import json_to_df
from aat_analysis.utils import merge_data

#from aat_analysis.

Define folder paths

  • raw should include the raw data from your experiment
  • external should include the contents of the Resources folder of your experiment app
  • interim and processed can be empty
external_folder = "../data/external/"
interim_folder = "../data/interim/"
raw_data_folder = "../data/raw/"
processed_data_file = "../data/processed/data.csv"

Preprocess data

# Creates empty dataframes to define expected data for each condition
templates = make_condition_templates(external_folder)
# Preprocesses data for each participant and moves it to interim
json_to_df(raw_data_folder, external_folder, interim_folder, templates)
# Merges interim data and stores it for further analysis
data = merge_data(interim_folder, drop=['interpolated','interpolated_gyro'])
data.to_csv(processed_data_file)
100%|█████████████████████████████████████████████| 3/3 [00:27<00:00,  9.24s/it]

AAT data

The selected columns below contain all data needed to calculate approach tendencies for each session, participant, and stimulus type. The additional data in the dataframe (not shown) are answers to other questions and some additional AAT variables.

data[['participant','condition','session','trial','is_practice','stimulus_set','stimulus','correct_response','response','accuracy','rt','force']]
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}
</style>
participant condition session trial is_practice stimulus_set stimulus correct_response response accuracy rt force
0 kmahu0zq condition_2 final_session 1 False None None None NA False NaN NaN
1 kmahu0zq condition_2 introduction_session_2 1 True practice_food stim_0154 push ND False NaN 8.124186
2 kmahu0zq condition_2 introduction_session_2 2 True practice_objects stim_1276 pull pull True 1206.0 12.130466
3 kmahu0zq condition_2 introduction_session_2 3 True practice_objects stim_1264 pull ND False NaN 1.651279
4 kmahu0zq condition_2 introduction_session_2 4 True practice_objects stim_1277 pull pull True 629.0 18.342323
... ... ... ... ... ... ... ... ... ... ... ... ...
6166 kmah8va6 condition_2 push_food_before_lunch_d5 132 False unhealthy_tempting stim_0025 pull pull True 346.0 9.024626
6167 kmah8va6 condition_2 push_food_before_lunch_d5 133 False unhealthy_non_tempting stim_0125 pull pull True 363.0 5.820239
6168 kmah8va6 condition_2 push_food_before_lunch_d5 134 False healthy_non_tempting stim_0226 pull pull True 492.0 8.345508
6169 kmah8va6 condition_2 push_food_before_lunch_d5 135 False healthy_tempting stim_0201 pull pull True 450.0 5.539470
6170 kmah8va6 condition_2 push_food_before_lunch_d5 136 False objects stim_1035 push pull False 308.0 6.589124

6171 rows × 12 columns

Metadata

Release files for aat-analysis 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aat-analysis 0.0.7
File Size Uploaded Provenance
aat_analysis-0.0.7.tar.gz 19.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aat-analysis 0.0.7
File Interpreter ABI Platform
aat_analysis-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 36.0 kB

Release files / aat_analysis-0.0.7.tar.gz

Download URL aat_analysis-0.0.7.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5334fc00ec3fe14b39b1e591cc38ac91e485bdde7174ebd6104ba6b81536c4ac
BLAKE2b-256 checksum
How to use checksums
94054f8c8c8e73ea211da082cf2f55eac42acb8af8e917148c147da6db70c9f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Release files / aat_analysis-0.0.7-py3-none-any.whl

Download URL aat_analysis-0.0.7-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5cb15e42a92b615612d961dc9ead3ac4dbdc80744578143f998216a322bddbb
BLAKE2b-256 checksum
How to use checksums
3ad9e2e838063822362e5d4eff77fec8cd17602344ac92d586cf64bbed6e34c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Security for aat-analysis 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page