title: Gamma regression R GLM vs SAS GENMOD
body: <p>I am trying to replicate gamma regression that I have in SAS with R. Unfortunately, I get completely different parameter estimation and I do not have any idea what could cause that. I was looking for answer to my problem on SO but I didn't find anything that cover it.</p>
  
  <p>My SAS code is:</p>
  
  <pre><code>proc genmod data=data;
  class var1 factor1 ;
  Make 'Obstats' Out=Outdata_G;
  model answer = var2 factor1 var3/
  offset= offset dist=Gamma link=log obstats;
  run;
  </code></pre>
  
  <p>I see that the var1 is used in class statement, but isn't used in model statement - can it change the results? (I cannot rerun the code).</p>
  
  <p>What I've done in R is:</p>
  
  <pre><code>glm(answer~var2+factor1+var3, data =(data), offset = offset, family = Gamma(link = "log"))
  </code></pre>
  
  <p>What could cause differences in results from those two pices of code?</p>
  
  <p>Thanks in advance!</p>