title: Opposite directions of exponential hazard model coefficients ( with survreg and glm poisson)
body: <p>I want to estimate an exponential hazards model with one predictor in R. For some reason, I am getting coefficients with opposite signs when I estimate it using a glm poisson with offset log t and when I just use the survreg function from the survival package. I am sure the explanation is perfectly obvious but I can not figure it out.</p>
  
  <p>Example</p>
  
  <pre><code>t &lt;- c(89,74,23,74,53,3,177,44,28,43,25,24,31,111,57,20,19,137,45,48,9,17,4,59,7,26,180,56,36,51,6,71,23,6,13,28,16,180,16,25,6,25,4,5,32,94,106,1,69,63,31)
  d &lt;- c(0,1,1,0,1,1,0,1,1,0,1,1,1,1,0,0,1,0,1,1,1,0,1,0,1,1,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1)
  p &lt;- c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1)
  df &lt;- data.frame(d,t,p)
  
  # exponential hazards model using poisson with offest log(t)
  summary(glm(d ~ offset(log(t)) + p, data = df, family = "poisson"))
  </code></pre>
  
  <p>Produces:</p>
  
  <pre><code>Coefficients:
              Estimate Std. Error z value Pr(&gt;|z|)    
  (Intercept)  -5.3868     0.7070  -7.619 2.56e-14 ***
  p             1.3932     0.7264   1.918   0.0551 .
  </code></pre>
  
  <p>Compared to</p>
  
  <pre><code># exponential hazards model using survreg exponential
  require(survival)
  summary(survreg(Surv(t,d) ~ p, data = df, dist = "exponential"))
  </code></pre>
  
  <p>Produces:</p>
  
  <pre><code>            Value Std. Error     z        p
  (Intercept)  5.39      0.707  7.62 2.58e-14
  p           -1.39      0.726 -1.92 5.51e-02
  </code></pre>
  
  <p>Why are the coefficients in opposite directions and how would I interpret the results as they stand?
  Thanks!</p>