View source: R/threshold_slope.R
threshold_slope | R Documentation |
This function finds the approximate value of x (=x_th) for which the value of the estimated psychometric function is equal to 'thresh' and the approximate value of slope in x_th.
threshold_slope( pfit, xfit, thresh = 0.5 )
pfit |
estimated values of the psychometric function |
xfit |
stimulus levels at which the function was estimated |
thresh |
criterion level at which to estimate threshold; default is 0.5 |
x_th
estimated threshold
slope
estimated value of slope, i.e. derivative of pfit at x_th
data("Miranda_Henson")
x = Miranda_Henson$x
r = Miranda_Henson$r
m = Miranda_Henson$m
numxfit <- 199; # Number of new points to be generated minus 1
xfit <- (max(x)-min(x)) * (0:numxfit) / numxfit + min(x)
# Find a plug-in bandwidth
bwd <- bandwidth_plugin( r, m, x)
pfit <- locglmfit( xfit, r, m, x, bwd )$pfit
prob <- 0.5 # Required threshold level
thr_sl <- threshold_slope( pfit, xfit, prob )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.