# [R] offset in survreg

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Oct 3 18:07:51 CEST 2007

```On Wed, 3 Oct 2007, Ming-Wen An wrote:

> Hello,
>
> I have a question regarding the use of an offset term with survreg(),
> in the Survival library.  In particular, I am trying to figure out on
> what scale the offset term should be.
>
> Here's a simple example with no censoring and no coefficients:
>
> ---------
> y = rlnorm(1000, meanlog = 10, sdlog = 2)
> delta = rep(1, 1000)
> int = rep(1, 1000)
>
> survreg(Surv(y,delta)~offset(10*int), dist = "lognormal")
>
> Call:
> survreg(formula = Surv(y, delta) ~ offset(10 * int), dist = "lognormal")
>
> Coefficients:
> (Intercept)
> -0.1317181
>
> Scale= 1.985558
>
> Loglik(model)= -11973.1   Loglik(intercept only)= -11973.1
> n= 1000
> ---------
>
> I would have expected the intercept estimate to be 10, since I
> specified offset = 10, unless the offset term should be specified on
> another scale.

The intercept coefficient is 10 less than without the offset term, as you
offset the linear predictor by 10.  That's what 'offset' means in English.

The scale is the linear predictor, mean log survival time in your case.
So you took observations from a distribution with meanlog of 10, and were
suprised that the meanlog estimate is 10+(-0.1317181)!

--
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

```