Schad, D., Hohenstein, S., Vasishth, S., & Kliegl, R. (2019). How to capitalize on *a priori *contrasts in linear (mixed) models: A tutorial. *Journal of Memory and Language*

**Abstract.** Factorial experiments in research on memory, language, and in other areas are often analyzed using analysis of variance (ANOVA). However, for effects with more than one numerator degrees of freedom, e.g., for experimental factors with more than two levels, the ANOVA omnibus F-test is not informative about the source of a main effect or interaction. Because researchers typically have specific hypotheses about which condition means differ from each other, a priori contrasts (i.e., comparisons planned before the sample means are known) between specific conditions or combinations of conditions are the appropriate way to represent such hypotheses in the statistical model. Many researchers have pointed out that contrasts should be “tested instead of, rather than as a supplement to, the ordinary ‘omnibus’ F test” (Hays, 1973, p. 601). In this tutorial, we explain the mathematics underlying different kinds of contrasts (i.e., treatment, sum, repeated, polynomial, custom, nested, interaction contrasts), discuss their properties, and demonstrate how they are applied in the R System for Statistical Computing (R Core Team, 2018). In this context, we explain the generalized inverse which is needed to compute the coefficients for contrasts that test hypotheses that are not covered by the default set of contrasts. A detailed understanding of contrast coding is crucial for successful and correct specification in linear models (including linear mixed models). Contrasts defined a priori yield far more useful confirmatory tests of experimental hypotheses than standard omnibus F-test.

This the author version of a paper to appear in the* Journal of Memory and Language. *

`remef`

is an R package designed for the removal of statistical effects.

(The `remef`

package is intended to replace the old `remef`

function.)

To get the current development version from github, you can use the package `devtools`

:

```
# install.packages("devtools")
devtools::install_github("hohenstein/remef")
```

`remef`

functionThe latest version of the standalone function is 0.6.10. This function will not be developed further, but remain available here. Please use its successor, the `remef`

*package*.

If you have already been working with the old standalone function, note that there are some syntactic differences to the new version in the package. See the github page for further information and examples.{jcomments off}

]]>Update 01-01-2013: Ben Bolker ( http://rpubs.com/bbolker/3363 ) shows how such functions can be set up more elegantly with the help of derive(), deparse(), and eval(), but it still is a bit of a hack anyway. My last checks of the nlmer-models were based on lme4_0.999999-0.

]]>

*Description*

eyetrackR is an R package providing a set of utility functions for the analysis of eyetracker data. Currently it is geared towards, but not limited to, eye movements during reading. Starting from the raw time series of x and y samples, the package allows automated classification into saccades and fixations, with adjustable saccade detection parameters. Saccade detection results in a fixation sequence. From this sequence, given additional input about the reading material, aggregate measures such as gaze durations (first-path dwell time on a word) or skipping probabilities are computed. The data are shaped into a format that facilitates analyses using a distributed-processing approach, i.e., taking into account influences of the neighboring words (or fixations) on the current fixation duration. Sample analyses demonstrate how these measures can be analyzed as a function of word and reader parameters, using linear mixed effects models.

The package also contains a number of utility functions, such as parseq, firstpass, plotsacc, and computeReadingMeasures.

See help files for individual parts listed below.

*Installation*

Download and save package to a directory, then from within R either install as a local source package using the package manager GUI or setwd() to that directory and type

install.packages("eyetrackR_0.16.tar.gz", repos = NULL, type="source")

*Procedure*

1. data preprocessing

(edf to ascii conversion, .dat, .msg, and .msg2 file creation and cleanup)

- preprocess (requires installed edf2asc utility by SR research)

(case management)

- xallsac_l3 (demo)

2. message file parser

- parse_msg_file (demo)
- parms1 # usage: data(parms1); contains detection parameters
- readSubjects

3. (micro-)saccade detection

- vecvel
- microsacc
- binsacc
- saccpar

4. analysis of fixation sequences

(currently mainly contains demos)

- xSetup1_l3 (demo)
- computeReadingMeasures
- xIndex_fix_l3_logical (demo)
- xSetup2_l3 (demo)

5. definition of aggregate measures

(currently only contains demos)

- xSetup2.2_dvmat_l3 (demo)

6. sample statistical analysis

*Author(s)*

Jochen Laubrock with Reinhold Kliegl, Ralf Engbert, Sarah Risse, Daniel Schad, Michael Dambacher

Maintainer: Jochen Laubrock

*References*

Laubrock & Kliegl (in preparation). eyetrackR: an R package for the analysis of eye movement data.

Engbert, R., & Mergenthaler, K. (2006) Microsaccades are triggered by low retinal image slip. Proceedings of the National Academy of Sciences of the United States of America, 103, 7192–7197.

*Examples*

` #############################################################`

## (micro-)saccade detection

#############################################################

data(trial4)

# names(trial4) <- c("t", "xl", "yl", "pl", "xr", "yr", "pr")

SAMPLING <- 500

VFAC <- 5

MINDUR <- 3

vl <- vecvel(trial4[,c("xl", "yl")], SAMPLING, 2)

sacl <- microsacc(trial4[,c("xl", "yl")], vl, VFAC, MINDUR)

vr <- vecvel(trial4[,c("xr", "yr")], SAMPLING, 2)

sacr <- microsacc(trial4[,c("xr", "yr")], vr, VFAC, MINDUR)

sacb <- binsacc(sacl$sac, sacr$sac)

sacb2 <- saccpar(sacb$sac)

#############################################################

## sentence corpus

#############################################################

data(PSC2.DWDS)

example(PSC2.DWDS)

`#############################################################`

## reading measures

#############################################################

data(a)

a2 <- computeReadingMeasures(a)

summary(a2)

` `

` `

` `

` `

]]>