psyfun.boot | R Documentation |
A function that will run a bootstrap on the estimated parameters of a psychometric function fit given a model object.
psyfun.boot(obj, N = 100)
obj |
object inheriting from class ‘glm’ from a fit of a psychometric function |
N |
integer indicating number of bootstrap replications. |
The function computes new binomial responses based on the fitted probabilities of the model object for each bootstrap replication. A psychometric function is then fit to each one and the fitted coefficients returned as a bootstrap replicate.
Returns a matrix with one row for each coefficient of the model and one column for each bootstrap replication.
Kenneth Knoblauch
Maloney, L. T. (1990) Confidence interval for the parameters of psychometric functions. Perception & Psychophysics, 47(2), 127–134.
Foster, D.H., Bischof, W.F.(1997) Bootstrap estimates of the statistical accuracy of thresholds obtained from psychometric functions. Spatial Vision, 11(1), 135–139.
Treutwein, B., Strasburger, H. (1999) Fitting the psychometric function. Perception & Psychophysics, 61(1), 87–106.
data(HSP)
SHR2 <- subset(HSP, Obs == "SH" & Run == "R2")
SHR2 <- within(SHR2, {
nyes <- N * p/100
nno <- N - nyes
})
SHR2.glm <- glm(cbind(nyes, nno) ~ log(Q), binomial, SHR2)
### For a real problem, set N to 10000 or so
SHR2.boot <- psyfun.boot(SHR2.glm, 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.