deviance2 | R Documentation |
This function calculates the deviance for the fitted values of the psychometric function pfit.
deviance2( r, m, pfit )
r |
number of successes |
m |
number of trials |
pfit |
fittd values |
D
deviance
data("Carcagno")
x = Carcagno$x
r = Carcagno$r
m = Carcagno$m
plot( x, r / m, xlim = c( 1.95, 4.35 ), ylim = c( 0.24, 0.99 ), type = "p", pch="*" )
guess = 1/3; # guessing rate
laps = 0; # lapsing rate
val <- binomfit_lims( r, m, x, link = "probit", guessing = guess, lapsing = laps )
pfit<-predict( val$fit, data.frame( x = x ), type = "response" )
d2 = deviance2( r, m, pfit )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.