View source: R/binom_revweib.R
| binom_revweib | R Documentation | 
This function finds the maximum likelihood estimates of the parameters of the reverse Weibull model for the psychometric function.
binom_revweib( r, m, x, p = 1, initK = 2, guessing = 0, lapsing = 0 )
r | 
 number of successes at points x  | 
m | 
 number of trials at points x  | 
x | 
 stimulus levels  | 
p | 
 (optional) degree of the polynomial; default is 1  | 
initK | 
 (optional) initial value for K (power parameter in reverse Weibull model); default is 2  | 
guessing | 
 (optional) guessing rate; default is 0  | 
lapsing | 
 (optional) lapsing rate; default is 0  | 
b     vector of estimated coefficients for the linear part
K     estiamte of the power parameter in the reverse Weibull model
fit   glm object to be used in evaluation of fitted values
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)
val <- binom_revweib( r, m, x )
# Plot the fitted curve
plot( x, r / m, xlim = c( 0.1, 1.302 ), ylim = c( 0.0165, 0.965 ), type = "p", pch="*" )
pfit <- predict( val$fit, data.frame( x = xfit ), type = "response" )
lines(xfit, pfit, col = "green" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.