class: center, middle, inverse, title-slide # Research Methods in Cognitive Science ## Week 11: Introduction to PsychoPy and Pavlovia ### Jason Geller, Ph.D. ### 2021-11-09 --- # Goals - Introduce you to PsychoPy - Make a basic experiment in PsychoPy - Put that experiment online using Pavlovia --- # What is PsychoPy - Software for behavioral studies - Written in Python - Free and open source - Now with capability to put studies online --- # What is Pavlovia? - Secure server to run studies online - Powerful web interface built around git - Huge repository of public experiments --- # What is Pavlovia? <img src="pavlovia.png" width="90%" style="display: block; margin: auto;" /> --- # What Else Is Pavlovia? - An online repository for experiments: - Public sharing - Collaboration - Git-based - version control --- # How do we use Pavlovia? 1. Check if the task we want already exists 2. Make/adapt task for our needs 3. Launch online 4. Recruit! --- # PsychoPy Overview - Builder <img src="builder.png" width="100%" style="display: block; margin: auto;" /> --- # PsychoPy Overview - GUI Buttons <img src="guibut.png" width="80%" style="display: block; margin: auto;" /> --- # Components <img src="comps.png" width="70%" style="display: block; margin: auto;" /> --- # Components - Text <img src="routinethanks.png" width="70%" style="display: block; margin: auto;" /> --- # Components - Movie <img src="movie.gif" width="70%" style="display: block; margin: auto;" /> --- # Components - Textbox <img src="textbox.gif" width="70%" style="display: block; margin: auto;" /> --- # Components - Image > Make your images approximately the size (in pixels) that you want them to be presented in. PsychoPy will resize your images for you, but it can take up a lot of working memory <img src="image.gif" width="70%" style="display: block; margin: auto;" /> --- # Components - Polygon > Draw shapes onto your display.The number of vertices determines the shape <img src="polygon.gif" width="70%" style="display: block; margin: auto;" /> --- # Response Components - Keyboard <img src="key.png" width="70%" style="display: block; margin: auto;" /> --- # Response Components - Button > Text that is clickable <img src="button.gif" width="70%" style="display: block; margin: auto;" /> --- # Response Components - Mouse <img src="mouse.gif" width="70%" style="display: block; margin: auto;" /> --- # Response Components - Slider <img src="slider.gif" width="70%" style="display: block; margin: auto;" /> --- class: inverse center middle # Let's make a simple experiment --- # Hello World - Create an experiment that displays "hello world" for 3 seconds --- <img src="hellopro.png" width="30%" style="display: block; margin: auto;" /> --- class: inverse center middle # Recognition Memory --- <img src="recog.png" width="70%" style="display: block; margin: auto;" /> --- # Flow - Routines - Combined to form an experiment - Can be standalone **things that are not repeated multiple times** - e.g., instructions - These do not have loops around them <img src="routine.png" width="70%" style="display: block; margin: auto;" /> --- # Flow - Loops and Trials <img src="trials.png" width="100%" style="display: block; margin: auto;" /> --- # Conditions List .pull-left[ - A conditions list MUST be created for each experiment in either csv or xlsx format - The column headers (variable names) CAN NOT have any spaces - Include variable names that will be used to identify components in the trial presentation - The correct path to the image file (or audio file or any stimulus file) MUST be used - Include the correct answers to responses to make accuracy calculations easier ] .pull-right[ <img src="condimage.png" width="100%" style="display: block; margin: auto;" /> ] --- # Loops <img src="loopdia.png" width="100%" style="display: block; margin: auto;" /> --- # Output: Response <img src="outputresp.png" width="100%" style="display: block; margin: auto;" /> --- # Output: Participant <img src="outputsubj.png" width="100%" style="display: block; margin: auto;" /> --- # Sync to Pavlovia <img src="sync.png" width="100%" style="display: block; margin: auto;" /> --- # Piolting and Running on Pavlovia <img src="pilotrun.png" width="100%" style="display: block; margin: auto;" /> --- # Viewing Results on Pavlovia <img src="view.png" width="100%" style="display: block; margin: auto;" />