Learn R Programming

MPDiR (version 0.2)

panel.psyfun: Panel Function for Adding Psychometric Function Fit to Each Panel

Description

Provides a panel function for use with xyplot from the lattice package so that a psychometric function will be fitted and plotted in each panel of a lattice plot similar to panel.lmline for fitting a linear regression line.

Usage

panel.psyfun(x, y, n, lnk = "logit", ...)

Value

Nothing returned. Function just used for its side-effects of producing a graph within a panel function.

Arguments

x

vector of covariate values

y

vector of responses, usually proportion of correct responses

n

vector of integers specifying number of trial for each proportion in y

lnk

link function to use in fitting glm with binomial family (default is “logit”).

...

Other parameters passed from the formal arguments of the panel function.

Author

Kenneth Knoblauch

See Also

See also as lattice

Examples

Run this code
lattice::xyplot(Pc ~ Phaseshift | WaveForm + TempFreq + 
	Direction, Vernier, layout = c(4, 2),
	panel = function(x, y, n = 20, ...) {
		lattice::panel.xyplot(x, y)
		panel.psyfun(x, y, 20, lnk = "probit")
	}
)

Run the code above in your browser using DataLab