bootstrap_sd_th {modelfree} | R Documentation |
Bootstrap standard deviation for the slope of a psychometric function
Description
The function finds a bootstrap estimate of the standard deviation of the estimated threshold for the local polynomial estimate of the psychometric function with guessing and lapsing rates.
Usage
bootstrap_sd_th( TH, r, m, x, N, h0, X = (max(x)-min(x))*(0:999)/999+min(x),
link = "logit", guessing = 0, lapsing = 0, K = 2, p = 1,
ker = "dnorm", maxiter = 50, tol = 1e-6 )
Arguments
TH |
required threshold level |
r |
number of successes at points x |
m |
number of trials at points x |
x |
stimulus levels |
N |
number of bootstrap replications; N should be at least 200 for reliable results |
h0 |
bandwidth |
X |
(optional) set of values at which estimates of the psychometric function for the threshold estimation are to be obtained; if not given, 1000 equally spaced points from minimum to maximum of 'x' are used |
link |
(optional) name of the link function; default is "logit" |
guessing |
(optional) guessing rate; default is 0 |
lapsing |
(optional) lapsing rate; default is 0 |
K |
(optional) power parameter for Weibull and reverse Weibull link; default is 2 |
p |
(optional) degree of the polynomial; default is 1 |
ker |
(optional) kernel function for weights; default is "dnorm" |
maxiter |
(optional) maximum number of iterations in Fisher scoring; default is 50 |
tol |
(optional) tolerance level at which to stop Fisher scoring; default is 1e-6 |
Value
sd
bootstrap estimate of the standard deviation of the threshold estimator
th0
threshold estimate
Examples
## Not run:
data("Miranda_Henson")
x = Miranda_Henson$x
r = Miranda_Henson$r
m = Miranda_Henson$m
bwd_min <- min( diff( x ) )
bwd_max <- max( x ) - min( x )
bwd <- bandwidth_cross_validation( r, m, x, c( bwd_min, bwd_max ), method = "deviance" )
prob <- 0.5 # Required threshold level
# This might take a few minutes
niter <- 200 # Note number of bootstrap iterations should be at least 200
th_sl <- bootstrap_sd_sl( prob, r, m, x, niter, bwd ) # Be patient, slow process
## End(Not run)