Archive for ‘News’

August 7, 2015

Bug fix #070815

In multivariable GLMM it is no longer necessary to put the continuous predictor in the first position in the formula object in order to estimate the JND and PSE via MERtreatment(). See MERdemo() for a working example.

July 30, 2015

Easy fit of psychometric functions

Using psych.function you can fit the data of the single participant (via call of standard glm function), estimate JND and PSE via delta method and plot the model predictions. The names of the Arguments are consistent with standard glm and lines function preceded by “ps.”; example ps.formula,, ps.col, etc. For the moment only works for univariable psychometric functions (lazy Italians…). See MERdemo.R and the on line tutorial for details. Write me for feedback/suggestions! ūüôā

June 30, 2015

Beep sound when bootstrap is finished

just a small change: In the pseMer function now you can set beep = T to play an alert sound when the bootstrap is finished. You need to install the package beepr to use this option. Thanks to Rasmus Baath, the author and maintainer of the package for this nice tool.

Tags: ,
February 24, 2015

Minor Changes in pseMer function

It is now possible to add a user-defined function, for e.g. to extract the PSE and JND (or an arbitrary parameter) from a multivariable model including continuous and categorical predictors. If no function is specified, pseMer assumes a simple model with a single continuous predictor. See MERdemo.R for a running example.

23:44 (Berlin time). Small bug due to a mistake in naming the R file. Now fixed

April 21, 2014

compatibility with lme4.1 (a first step)

Dear all,

I am working on the new version of the package to make it compatible with lme4.1. You can download  it here or in the Blogrol.

The main idea in the new version of the package is to create a function (I called it xplode.mer) extracting all the values from the fitted model, that are necessary for the MERpsychophysics package. This way, if the internal structure of the lme4 will change, I have to modify the xplode.mer function only.

The function based on the delta method is ready. About the bootstrap-based estimate of the PSE: for the moment I wrote a very simple function based on bootMer{lme4.1}. I called it pseMer(). I am still planning to  work on my own boot function (based on my previous function MERboot) Рstay tuned!

Along with the new function you will find a demo in R to use the xplode.mer function. I will add the user manual and the other functions ASAP. As usual, write me for info/suggestions/bug report. For the moment, I will keep in the blogroll also the old version of the code (compatible with lme4.0)






October 23, 2012

MERpsychophysics (beta release)

The package MERpsychophysics contains a collection of R functions for the analysis of psychophysical data in R.You can download the package by clicking here or on MERpsychophysics R code in the Blogroll. Together with the r-files, you should also receive a copy of the GNU Public License (LICENSE.txt) and the reference manual (MERpsychophysics_Reference_Manual.pdf). In order to load the package on your current R workspace, you should:

  1. Unzip the MERpsychophysics.0 folder, if necessary.
  2. Put the MERpsychophysics.0 folder ¬†in your favorite path (e.g. “/Users/alessandro”)
  3. Open the R session, and type: setwd(“my path/MERpsychophysics.0”) – for example, setwd(“/Users/alessandro/MERpsychophysics.0”)
  4. Type: source(“MERpsychophysics.r”)
  5. Use again the setwd function in order to change the working directory. For example: setwd(“my path/my data folder”). If you don’t change the working directory, all exported file will be saved in MERpsychophysics.0 folder.
  6. Have fun with it! If is the first time you use the package, you might want to open the file MERdemo.r and see some examples.

It is necessary to repeat steps 3-4 at each new working session Рor simply write the the two command lines at the beginning of your R script.  The first time you use the MERpsychophysics, remember to install all the R packages indicated in the Reference Manual.

The code provides the following tools for   the analysis of psychophysical data with the Generalized Linear Mixed Model (GLMM):

  • Estimate of PSE and JND and their confidence interval with Bootstrap Method
  • Estimate of PSE and JND and their variance with Delta Method
  • GLMM plotting

The CRAN package lme4.0 is used for GLMM fitting. This package is widely used in the statistical community for the analysis of clustered data. Please, refer to the CRAN and to the lme4 web-page for further details on this package (you will find all the links here).  The MERpsychophysics.0 is compatible with the  version of lme4.0 (not with the the current CRAN version version lme4.1). See here to install lme4.0 (if you are running on OS X Maverick see also here).

Algorithms used in MERpsychophysics for PSE and JND, which are not in the lme4 package, are referenced in the following article:

Moscatelli A, Mezzetti M, Lacquaniti F (2012). Modelling Psychophysical Data at the Population-Level: The Generalized Linear Mixed Model. Journal of Vision, 12(11):26.

The article is OPEN access. In the web site of  the Journal of Vision, you will also find the figures of the article in full-quality and original size. Please, cite the article if using the MERpsychophysics package for your data analysis!

The code is in a beta release, I am considering to write it as CRAN package later on – any feedback is welcome!

Contacts details are in the Blogroll.

Tags: ,