bootstrap_sd_sl: Bootstrap standard deviation for the slope of a psychometric...

View source: R/bootstrap_sd_sl.R

bootstrap_sd_slR 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 slope for the local polynomial estimate of the psychometric function with guessing and lapsing rates.

Usage

bootstrap_sd_sl( 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 slope 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 slope estimator

⁠sl0 ⁠ slope 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
sd_sl <- bootstrap_sd_sl( prob, r, m, x, niter, bwd ) # Be patient, slow process

## End(Not run)

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