from IPython.core.display import HTML, Markdown, display

import numpy.random as npr
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import scipy.stats as stats
import statsmodels.formula.api as smf
import ipywidgets as widgets

import os

Lab 1C: Mental Rotation

As described in the reading, in the Shepard & Metzler (1971) experiments, the time it took people to decide if an object was the same (just rotated) or different (a mirror reflection) depended on the angle of rotation:

In other words, it would take you longer to decide if the 30 degree rotated version of your cup was the same as the upright version relative to the 15 degree rotated version. The idea is that in order to make the same/mirror judgement, people actually mentally rotate the object. Bigger angles require more time to “rotate” in your mind just as they would in the real world (see Figure above).

Here is a key to the structure of the dataframe:

  • Trial: trial number.

  • Condition: Filename of stimulus

  • Time: Response time

  • correct: Correct (desired) response, in other words, the trial type

  • response: Actual response

  • angle: Angle (angular disparity, see paper)

  • correct/incorrect: Was the response correct or incorrect?

# this is an example list comprehension which reads in the all the files.
# the f.startswith() part just gets rid of any junk files in that folder 
filenames=['lab2-data/'+f for f in os.listdir('lab2-data') if not f.startswith('.')]