PsychShape: Plot Psychometric Functions given PSE and JND

Description Usage Arguments Details Value References See Also Examples

View source: R/psych_utils.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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 equivalende (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.

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.

Value

PsychShape returns a ggplot object.

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.

Examples

1
2
3
4
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)

MixedPsy documentation built on Nov. 9, 2021, 1:08 a.m.