PsychShape: Plotting Psychometric Functions given PSE and JND

Description Usage Arguments Details References See Also Examples

View source: R/psych_utils.R

Description

PsychShape() plots a psychometric function with known pse and jnd on an existing plot.

Usage

1
2
PsychShape(pse = 0, jnd, x.range = c(NA, NA), ps.link = "probit",
  ps.col = "black", ps.lwd = 1, ps.lty = "solid")

Arguments

pse, jnd

the pse and the jnd of the desired psychometric function

x.range

a vector of length two specifying the range of the function

ps.link

a link function for the binomial family of error distribution (see Details).

ps.col

color of the line to be plotted

ps.lwd

line width

ps.lty

line type

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.

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. https://doi.org/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 for estimation of PSE and JND.

Examples

1
2
3
4
5
6
y = c(0,1)
x = c(-40, 40)
plot(y ~ x, type = "n", bty = "n", lab = c(5,3,7))
PsychShape(pse = 0, jnd = 6, x.range = c(-40, 40), ps.col = "gray", ps.lwd = 3)
PsychShape(pse = 6, jnd = 6, x.range = c(-40, 40), ps.col = "black")
PsychShape(pse = 6, jnd = 6, x.range = c(-40, 40), ps.col = "red", ps.link = "logit", ps.lwd = 3)

MixedPsy documentation built on May 2, 2019, 3:40 p.m.