title: train() function and rate model (poisson regression with offset) with caret
body: <p>I fitted a rate model using <code>glm()</code> (poisson link with offset, like</p>
  
  <pre><code>y ~ offset(log(x1)) + x2 + x3
  </code></pre>
  
  <p>the response is <code>y/x1</code> in this case).</p>
  
  <p>Then I wanted to do cross validation using <strong>caret</strong> package so I used 'train()' function with <em>k</em>-fold CV control. It turns out the 2 models I have are very different. It seems that <code>train()</code> can't handle <code>offset</code>: I change the variable within <code>offset</code> to be <code>offset(log(log(x1))</code> or <code>offset(log(sqrt(x1))</code>, the models remain the same.</p>
  
  <p>Any one have this kind of experience before and how did you deal with it? 
  Thanks!</p>
  
  <p>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. </p>