Dear All,
I am simply baffled by a problem I have been having recently with the anova
command. If I have the following command in a function it will not evaluate
it and comes up with an error message.
model1 <- function()
{
i <- 247 #any number
anova(glm(AccTotal[97:264,i] ~ TT$amv[1:168] ,family = poisson))
}
The above code seems to work fine with any other function like "coef" or
"summary" but will not work for anova, which is very frustrating in a
situation involving loops.
the error message I get is the following:
Problem in eval(oc, list()): Object "i" not found
Use traceback() to see the call stack
advance thanks for help
James
|