deviance2: Deviance of a psychometric function

View source: R/deviance2.R

deviance2R Documentation

Deviance of a psychometric function

Description

This function calculates the deviance for the fitted values of the psychometric function pfit.

Usage

deviance2( r, m, pfit )

Arguments

r

number of successes

m

number of trials

pfit

fittd values

Value

⁠D ⁠ deviance

Examples

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 )


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