R/ClassLog.R

"ClassLog" <- function(MOD, resp, cut=.5)
{
 classtab <- prop.table (table (predict(MOD, type='response') > cut, resp), 2)
 rawtab <- table (predict(MOD, type='response') > cut, resp)
 overall <- sum(diag(prop.table (table (predict(MOD, type='response') > cut, resp))))
 mcFadden <- 1 - MOD$deviance/MOD$null.deviance 
 return(
 	list(
 		rawtab=rawtab, 
 		classtab=classtab, 
 		overall=overall, 
 		mcFadden=mcFadden)
 		)
 }

Try the QuantPsyc package in your browser

Any scripts or data that you put into this service are public.

QuantPsyc documentation built on June 4, 2022, 1:06 a.m.