threshold_slope: Estimates of threshold and slope for a fitted psychometric...

View source: R/threshold_slope.R

threshold_slopeR Documentation

Estimates of threshold and slope for a fitted psychometric function

Description

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.

Usage

threshold_slope( pfit, xfit, thresh = 0.5 )

Arguments

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

Value

⁠x_th ⁠ estimated threshold

⁠slope ⁠ estimated value of slope, i.e. derivative of pfit at x_th

Examples

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 )


modelfree documentation built on May 31, 2023, 7:17 p.m.