Skip to content

Instantly share code, notes, and snippets.

Avatar

Titus von der Malsburg tmalsburg

View GitHub Profile
@tmalsburg
tmalsburg / psychling_journals.opml
Last active Apr 25, 2022
RSS feeds of journals publishing work in (psycho)linguistics
View psychling_journals.opml
<?xml version="1.0"?>
<opml version="1.0">
<head>
<title>(Psycho)linguistics journals</title>
</head>
<body>
<outline title="Annual Rev Ling" xmlUrl="https://www.annualreviews.org/action/showFeed?ui=45mu4&amp;mi=3fndc3&amp;ai=6690&amp;jc=linguistics&amp;type=etoc&amp;feed=atom"/>
<outline title="Brain &amp; Language" xmlUrl="https://rss.sciencedirect.com/publication/science/0093934X"/>
<outline title="Cognition" xmlUrl="http://rss.sciencedirect.com/publication/science/00100277"/>
<outline title="Cognitive Science" xmlUrl="https://onlinelibrary.wiley.com/feed/15516709/most-recent"/>
@tmalsburg
tmalsburg / week04.org
Created Nov 6, 2019
Sample org file for teaching slides
View week04.org

Foundations of Math

Agenda for today

@tmalsburg
tmalsburg / README.org
Last active May 12, 2018
R functions for calculating binomial credible intervals
View README.org
@tmalsburg
tmalsburg / Instructions.md
Last active Mar 10, 2022
LaTeX template for articles in APA format
View Instructions.md

Compile this template by executing the following in a command shell:

  pdflatex test && biber test && pdflatex test && pdflatex test

This template uses biblatex and biber instead of good old BibTeX. The bibliography files (*.bib) can have the same format (although biblatex allows using some interesting extensions). However, the biblatex+biber combo is much more powerful than good-old BibTeX (e.g. support for multiple bibliographies in one document) and comes with great documentation.

Suggestions for improvements welcome.

@tmalsburg
tmalsburg / rmarkdown-render.el
Last active Apr 26, 2018
Elisp function for rendering RMarkdown files to PDF. Shows the output of the render process in a separate window.
View rmarkdown-render.el
(defun tmalsburg-rmarkdown-render ()
"Compiles the current RMarkdown file to PDF and shows output of
the compiler process in a separate window."
(interactive)
(let* ((buf (get-buffer-create "*rmarkdown-render*"))
(temp-window (or (get-buffer-window buf)
(split-window-below -10)))
(command "Rscript -e 'library(rmarkdown); render(\"%s\", output_format=\"%s\")'")
(command (format command (buffer-file-name) "pdf_document")))
(set-window-buffer temp-window buf)
@tmalsburg
tmalsburg / mturk_completion_times.org
Last active Jun 15, 2016
How to correctly calculate worker compensation for Amazon Mechanical Turk
View mturk_completion_times.org

How to correctly calculate worker compensation for Amazon Mechanical Turk

tl;dr: When calculating the average time it takes to complete a HIT, it may be more appropriate to use the geometric mean or the median instead of the arithmetic mean. You may otherwise spend considerably more money than necessary (in our case 50% more).


View LatinSquaresWithIbex.org

A potential pitfall when running Ibex experiments on Amazon Mechanical Turk

Ibex does Latin squares in a way that can potentially have serious unintended consequences in the form of spurious effects.

The problem: When you submit an experiment to Amazon Mechanical Turk, a lot of workers will immediately jump at it but the rate of participation quickly decays (the distribution over time often looks like an exponential decay). For every participant, Ibex selects a stimulus list based on an internal counter and this counter is incremented when a participant submits their results. Unfortunately, this means that the initial wave of participants all work on the same list of the Latin square and this list will therefore be strongly overrepresented. This can lead to strong spurious effects that are not due to the experimental manipulation but due to between-item differences. This is an easy-to-miss problem and I would not be surprised if some published results obtained with Ibex were false because of this prob

@tmalsburg
tmalsburg / bold_author_hack.tex
Last active Aug 29, 2015
CV written in org-mode
View bold_author_hack.tex
\usepackage{xpatch}% or use http://tex.stackexchange.com/a/40705
\def\makenamesetup{%
\def\bibnamedelima{~}%
\def\bibnamedelimb{ }%
\def\bibnamedelimc{ }%
\def\bibnamedelimd{ }%
\def\bibnamedelimi{ }%
\def\bibinitperiod{.}%
\def\bibinitdelim{~}%
@tmalsburg
tmalsburg / predict_vs_simulate.org
Last active Feb 9, 2022
Predict vs simulate in lme4
View predict_vs_simulate.org

Predict vs simulate in lme4

For this investigation we are going to use the sleepdata data set from the lme4 package. Here is the head of the data frame:

@tmalsburg
tmalsburg / test_simulate.R
Last active Aug 29, 2015
Test how simulate.merMod deals with new factor levels
View test_simulate.R
library(lme4)
head(sleepstudy)
summary(sleepstudy)
# Relabel subjects:
d <- sleepstudy
d$Subject <- factor(rep(1:18, each=10))
# Fit model: