Hi All,
Could someone help me decode what this error means ?
Error in log(attr(object, "nobs")) :
Non-numeric argument to mathematical function
BTW, nb.80 is a negative binomial glm model created using the MASS
library with the call at the bottom of the message
In the hopes of trying to figure this out I tried the following
workaround but it did not work either
since AIC = (Deviance(Mu) + 2C) / N
where: Mu is deviance of unconstrained model
C is number of coefficients
N is sample size
and BIC = Deviance(Mu) - (df1 *ln(N))
where: Mu is deviance of unconstrained model
df1 is the sample size minus the number of coeffcients
N is the sample size
thus by substitution BIC = (AIC*N - 2C) - (df1 * ln(N))
In R the code I tried was:
AIC.80<-AIC(nb.80)
first.term <- AIC.80*length(Sample.80)-2*length(nb.80$coefficients)
second.term <-
length(Sample.80)-length(nb.80$coefficients)*log(length(Sample.80))
BIC.80 <- first.term - second.term
The results of my code seem completely out of whack, the BIC should be
somewhat close to the AIC and thus I am most assuredly not understanding
some fundamental principle here:
[1] 413368.9
How does one surmount my original error of "Error in log(attr(object,
"nobs")) : Non-numeric argument to mathematical function" ?
-Don