fitPPCurve: Modelfree derivate to fit a psychometric curve

Description Usage Arguments Value Author(s) See Also Examples

View source: R/fitPPCurve.R

Description

This function use the 'modelfree'package to fit locally the data of a psychophysic experiment (see http://personalpages.manchester.ac.uk/staff/d.h.foster/software-modelfree/latest/index.html)

Usage

1
fitPPCurve(stim_level, nb_corr, nb_trials)

Arguments

stim_level

A vector of the different level of the physical stimulation (e.g. luminance, sound intensity...). If strings are used, the function will convert the stings as simple digits.

nb_corr

A vector of the number of 'correct' responses of a given subject in a given condition.

nb_trials

A vector of number of trials of a given subject in a given condition (should be of the same length than the nb_corr).

Value

Return a list with a vector of fitted value for each point of the initial nb_corr variable and the extracted slope, PSS and JND values.

Author(s)

Guillaume T. Vallet gtvallet@gmail.com, Universit\'e de Montr\'eal

Maintainer: Guillaume T. Vallet gtvallet@gmail.com

See Also

See vignette("locglmfit", package = "modelfree") for more details on the fit function used.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
### Generate fake date to use the function ---------------------------------
# Levels of the physical stimulation
stim = 1:10
# Number of correct responses for each level of stim
corr = c(0, 0, 3, 5, 10, 14, 16, 18, 19, 20)
# Number of trial per condition actually included
trials = c(20, 20, 19, 20, 18, 19, 20, 20, 19, 20)

### Fitting the curve with the modelfree adapation -------------------------
fitted = fitPPCurve(stim, corr, trials)
fitted

### Visuallizing the fit ---------------------------------------------------
plot(stim, corr/trials)
lines(stim, fitted$pfit, col='red')

Cogitos/pphy documentation built on May 6, 2019, 12:21 p.m.