Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aylin Kallmayer authored and Aylin Kallmayer committed Feb 1, 2019
1 parent ac3f470 commit 0774764
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 241 deletions.
50 changes: 25 additions & 25 deletions docs/chapter_exp/Programming Experiments in Psychopy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ measured with higher precision.

Some of Galton's tools. The pendulum chronograph is more complicated than any of these!

Public domain image taken from :cite:`@johnson1985galton`.
Public domain image taken from 'citation missing'.

.. _Pendulum chronograph: http://galton.org/essays/1880-1889/galton-1889-rba-reaction-time.pdf

Expand All @@ -40,25 +40,25 @@ lack precision. Also, to be frank -- they sound like a lot of work! While some
might decry a lack of entrepreneurial spirit, most of us will readily admit the
advantage of computerized methods.

Progress has made the work of the researcher much simpler. (Remember this
sentence whenever you feel frustrated attempting to program an experiment! At
least you are not Galton, keeping a pendulum chronograph in working condition,
Progress has made the work of the researcher much simpler. (Remember this
sentence whenever you feel frustrated attempting to program an experiment! At
least you are not Galton, keeping a pendulum chronograph in working condition,
or walking across London to mentally file people into rather crude and
subjective boxes.) Today, computers can show various visual input, play all
kinds of sounds, and accurately measure ... well, a narrow kind of behavioral
responses made by experimental participants. Our computer's graphics and sound
cards, and the keyboard and mouse drivers, are relatively arcane. There is as of
yet no convenient way to get a computer to show words or pictures on a screen
for the purposes of psychological experiments from our favourite programming
language, R. There are many commercial, closed-source solutions, which we will
subjective boxes.) Today, computers can show various visual input, play all
kinds of sounds, and accurately measure ... well, a narrow kind of behavioral
responses made by experimental participants. Our computer's graphics and sound
cards, and the keyboard and mouse drivers, are relatively arcane. There is as of
yet no convenient way to get a computer to show words or pictures on a screen
for the purposes of psychological experiments from our favourite programming
language, R. There are many commercial, closed-source solutions, which we will
all ignore in favour of the powerful and open Python options.

Why? Perhaps the most important benefit computerized experiments have is that
they are much more reproducible. Using an Open Source program and making
experimental stimuli and scripts available online allows other researchers to 1.
exactly retrace what happened in the original experiment, 2. repeat it ad
libitum. To actually exploit this reproducibility potential, we must use
software that is open. The biggest open source experimental presentation
Why? Perhaps the most important benefit computerized experiments have is that
they are much more reproducible. Using an Open Source program and making
experimental stimuli and scripts available online allows other researchers to 1.
exactly retrace what happened in the original experiment, 2. repeat it ad
libitum. To actually exploit this reproducibility potential, we must use
software that is open. The biggest open source experimental presentation
software is Psychopy :cite:`peirce2007psychopy`.

Programming Experiments in Python with Psychopy
Expand All @@ -68,11 +68,11 @@ Psychopy allows us to write simple and readable Python code to control our
computer's low-level capacity for displaying and playing stimuli. Why is this
necessary? Because we need to work with the computer on a low level in order to
get it to achieve highly precise timings, and smoothly display even complex
visual stimuli. That is one half of the experimental program; the other will
consist in translating the `experimental design`_ into
visual stimuli. That is one half of the experimental program; the other will
consist in translating the experimental design into
computer code, so that, e.g., a study participant is presented with the required
number of trials resulting from your `power calculation`_ for the
conditions resulting from your `latin square design`_.
number of trials resulting from your power calculation for the
conditions resulting from your latin square design.

Because Psychopy is written in Python, we having already learned Python,
learning Psychopy reduces to learning the Psychopy-specific modules.
Expand Down Expand Up @@ -109,7 +109,7 @@ it to show it, paint the new backside, flip again to show and clear, and repeat.

The visual stimuli we can paint on screens live in the ``psychopy.visual``
submodule. This includes various geometric shapes, as well as the ``TextStim``
and ``ImageStim`` classes, which we will discuss extensively in the following.
and ``ImageStim`` classes, which we will discuss extensively in the following.

For movie stimuli, see the MovieStim_
class. Other stimuli include random dot motion and grating stimuli.
Expand Down Expand Up @@ -153,7 +153,7 @@ are only ever approximations; i.e.,
Even with modern computer technology, the accuracy of stimulus presentation
timing is never better than the screen refresh rate. For example, many laptop
monitors have refresh rates of 60 Hz. That is, they can at most show a new
stimulus 16.5 ms after the previous stimulus, and all stimulus
stimulus 16.5 ms after the previous stimulus, and all stimulus
timing intervals will *at best* be multiples of 16.5.

.. _many digital devices could not record increments shorter than 100 ms: http://deevybee.blogspot.com/2013/05/have-we-become-slower-and-dumber.html
Expand All @@ -168,7 +168,7 @@ presentation onset is preceded by a delay. Typically, this delay will be
approximately the same on every trial; but it will lead to a systematic
underestimation of stimulus onsets.

For experiments requiring extremely precise measurements, it becomes crucial to
For experiments requiring extremely precise measurements, it becomes crucial to
measure, minimize and account for inaccuracy and bias. For this, external
hardware is required; i.e., light- or sound pressure sensitive detectors.
(For a cheap solution, the Raspberry Pi mini-computer can easily be
Expand Down Expand Up @@ -212,7 +212,7 @@ typically, to ensure precise measurements, time-sensitive experiments were
still restricted to dedicated lab computers. Recently, javascript-based
tools have made it possible to deliver experiments over the internet, and
conduct them in a web browser.

Online Experiments with the Psychopy Builder
++++++++++++++++++++++++++++++++++++++++++++

Expand Down
24 changes: 12 additions & 12 deletions docs/chapter_exp/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ @article{garaizar2014accuracy

@Article{Plant2016,
author="Plant, Richard R.",
title="A reminder on millisecond timing accuracy and potential replication failure in computer-based
title="A reminder on millisecond timing accuracy and potential replication failure in computer-based
psychology experiments: An open letter",
journal="Behavior Research Methods",
year="2016",
Expand All @@ -42,21 +42,21 @@ @Article{Plant2016
volume="48",
number="1",
pages="408--411",
abstract="There is an ongoing `replication crisis' across the field of psychology in which researchers,
funders, and members of the public are questioning the results of some scientific studies and the validity of
the data they are based upon. However, few have considered that a growing proportion of research in modern
psychology is conducted using a computer. Could it simply be that the hardware and software, or experiment
generator, being used to run the experiment itself be a cause of millisecond timing error and subsequent
replication failure? This article serves as a reminder that millisecond timing accuracy in psychology studies
remains an important issue and that care needs to be taken to ensure that studies can be replicated on current
abstract="There is an ongoing `replication crisis' across the field of psychology in which researchers,
funders, and members of the public are questioning the results of some scientific studies and the validity of
the data they are based upon. However, few have considered that a growing proportion of research in modern
psychology is conducted using a computer. Could it simply be that the hardware and software, or experiment
generator, being used to run the experiment itself be a cause of millisecond timing error and subsequent
replication failure? This article serves as a reminder that millisecond timing accuracy in psychology studies
remains an important issue and that care needs to be taken to ensure that studies can be replicated on current
computer hardware and software.",
issn="1554-3528",
doi="10.3758/s13428-015-0577-0",
url="https://doi.org/10.3758/s13428-015-0577-0"
}

@article{woodley2013were,
title={Were the Victorians cleverer than us? The decline in general intelligence estimated from a
title={Were the Victorians cleverer than us? The decline in general intelligence estimated from a
meta-analysis of the slowing of simple reaction time},
author={Woodley, Michael A and Te Nijenhuis, Jan and Murphy, Raegan},
journal={Intelligence},
Expand All @@ -78,9 +78,9 @@ @Article{Vadillo2016
volume="17",
number="1",
pages="147",
abstract="Technical noise can compromise the precision and accuracy of the reaction times collected in
psychological experiments, especially in the case of Internet-based studies. Although this noise seems to have
only a small impact on traditional statistical analyses, its effects on model fit to reaction-time
abstract="Technical noise can compromise the precision and accuracy of the reaction times collected in
psychological experiments, especially in the case of Internet-based studies. Although this noise seems to have
only a small impact on traditional statistical analyses, its effects on model fit to reaction-time
distributions remains unexplored.",
issn="1471-2105",
doi="10.1186/s12859-016-0993-x",
Expand Down
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['nstatic']
html_static_path = []

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down Expand Up @@ -170,4 +170,3 @@

## for citations
extensions = ['sphinxcontrib.bibtex']

159 changes: 0 additions & 159 deletions docs/conf_old.py

This file was deleted.

Binary file not shown.
Binary file modified docs/nbuild/doctrees/environment.pickle
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/nbuild/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 6a064e1ee4fb7109ecfaed8fd9ee17a7
config: e708a297f4d4db03f81ceb3dad27acec
tags: 645f666f9bcd5a90fca523b33c5a78b7

0 comments on commit 0774764

Please sign in to comment.