Description Usage Arguments Value Author(s) See Also Examples
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)
1 | fitPPCurve(stim_level, nb_corr, nb_trials)
|
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). |
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.
Guillaume T. Vallet gtvallet@gmail.com, Universit\'e de Montr\'eal
Maintainer: Guillaume T. Vallet gtvallet@gmail.com
See vignette("locglmfit", package = "modelfree")
for more details on
the fit function used.
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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.