I fitted a rate model using glm() (poisson link with offset, like
y ~ offset(log(x1)) + x2 + x3
the response is y/x1 in this case).
Then I wanted to do cross validation using caret package so I used 'train()' function with k-fold CV control. It turns out the 2 models I have are very different. It seems that train() can't handle offset: I change the variable within offset to be offset(log(log(x1)) or offset(log(sqrt(x1)), the models remain the same.
Any one have this kind of experience before and how did you deal with it? Thanks!
btw I want to save the prediction on each validation set so so far I only know caret can do that, thats why I didnt choose to use cv.glm.