getDev {mseq} | R Documentation |
Calculate the deviance under Poisson model.
getDev(pred_count, real_count)
pred_count |
the fitted or predicted counts |
real_count |
the real counts in the data |
the deviance, a single numeric value
Hardin JW, Hilbe JM: Generalized Linear Models and Extensions. 2 edn. College Station, TX: Stata Press; 2007.
# read and expand the data data(g1_part) # for real data, please use read.csv, like g1 <- read.csv("g1.csv") data <- expData(g1_part, 2, 3) null.count <- getNullCount(data) null.dev <- getDev(null.count, data$count)