PsychShape function

Plot Psychometric Functions given PSE and JND

Plot Psychometric Functions given PSE and JND

Plot a psychometric function with known PSE and JND on a new or existing ggplot object.

PsychShape( pse = 0, jnd = 1, p = 0.75, x.range = c(NA, NA), ps.link = c("probit"), ps.type = "solid", ps.size = 1, ps.color = "black", addTo = NULL )

Arguments

  • pse, jnd: point of subjective equivalence (PSE) and just noticeable difference (JND) of the desired psychometric function.
  • p: probability value relative to the JND upper limit. Default is 0.75 (value for 50% JND).
  • x.range: vector of length two specifying the range of the psychometric function.
  • ps.link: a link function for the binomial family of error distribution.
  • ps.type, ps.size, ps.color: type, size, and color of the plotted line (see "ggplot2-spec").
  • addTo: specifies an existing ggplot object where the new line should be plotted. If no object is given, the function is drawn on a new plot.

Returns

PsychShape returns a ggplot object.

Details

PsychShape() can be used to visualize the predicted results of a psychophysical experiment or to plot a fitted psychometric function whose values of pse and jnd are known. Currently only working with probit and logit link function.

Examples

p <- PsychShape(pse = 0, jnd = 6, x.range = c(-40, 40), ps.color = "gray", ps.size = 3) p1 <- PsychShape(pse = 6, jnd = 6, x.range = c(-40, 40), ps.col = "black", addTo = p) p2 <- PsychShape(pse = 6, jnd = 6, x.range = c(-40, 40), ps.col = "red", ps.link = "logit", ps.type = "dashed", addTo = NULL)

References

Moscatelli, A., Mezzetti, M., & Lacquaniti, F. (2012). Modeling psychophysical data at the population-level: The generalized linear mixed model. Journal of Vision, 12(11):26, 1-17. doi:10.1167/12.11.26

Knoblauch, K., & Maloney, L. T. (2012). Modeling psychophysical data in R (Vol. 32). Springer Science & Business Media.

See Also

glm for for Generalized Linear Models. PsychFunction and PsychDelta for estimation of PSE and JND from response data. PsychPlot for plotting a a psychometric function from a GLM.

  • Maintainer: Alessandro Moscatelli
  • License: GPL (>= 2)
  • Last published: 2025-02-18