Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aat-analysis

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aat-analysis

This project analyzes mobile AAT data.

  • 0.0.7
  • PyPI
  • Socket score

Maintainers
1

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']]
.dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; }
participantconditionsessiontrialis_practicestimulus_setstimuluscorrect_responseresponseaccuracyrtforce
0kmahu0zqcondition_2final_session1FalseNoneNoneNoneNAFalseNaNNaN
1kmahu0zqcondition_2introduction_session_21Truepractice_foodstim_0154pushNDFalseNaN8.124186
2kmahu0zqcondition_2introduction_session_22Truepractice_objectsstim_1276pullpullTrue1206.012.130466
3kmahu0zqcondition_2introduction_session_23Truepractice_objectsstim_1264pullNDFalseNaN1.651279
4kmahu0zqcondition_2introduction_session_24Truepractice_objectsstim_1277pullpullTrue629.018.342323
.......................................
6166kmah8va6condition_2push_food_before_lunch_d5132Falseunhealthy_temptingstim_0025pullpullTrue346.09.024626
6167kmah8va6condition_2push_food_before_lunch_d5133Falseunhealthy_non_temptingstim_0125pullpullTrue363.05.820239
6168kmah8va6condition_2push_food_before_lunch_d5134Falsehealthy_non_temptingstim_0226pullpullTrue492.08.345508
6169kmah8va6condition_2push_food_before_lunch_d5135Falsehealthy_temptingstim_0201pullpullTrue450.05.539470
6170kmah8va6condition_2push_food_before_lunch_d5136Falseobjectsstim_1035pushpullFalse308.06.589124

6171 rows × 12 columns

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc