I have following two models (fit1, fit2) estimated using nls approach. I want to compare their goodness using anova, and the results follows:
dd <- data.frame(t=0:10,
Frequency=c(195746,93938,53181,31853,19856,12182,
7847,5459,4325,3203,2750))
model1 <- deriv( ~ c*(1+b*(q-1)*t)^(1/(1-q)),
c("c", "b", "q"), function (t, c, b,q){})
par1 <- list(c = 1e5, b = 1.5, q =2)
fit1 <- nls(Frequency ~ model1(t, c, b, q), data=dd,start=par1)
model3 <- deriv( ~ exp(-beta1*t)/(beta2+beta3*t),c("beta1", "beta2", "beta3"),
function (t, beta1, beta2,beta3){})
par3 <- list(beta1 = .0100, beta2 = .0002, beta3 =0.0002)
fit3 <- nls(Frequency ~ model3(t, beta1,beta2,beta3), data=dd,start=par3)
anova(fit3,fit1,test="Chisq")
Model 1: Frequency ~ model(t, beta1, beta2, beta3)
Model 2: Frequency ~ model(t, c, b, q)
Res.Df Res.Sum Sq Df Sum Sq F value Pr(>F)
1 78 11892917
2 78 14080592 0 0
I am still not sure if I can use anova? Or if there is another approach I would appreciate it if you let me know about...