[R] Offset - usersplits function package RPART

Terry Therneau therneau at mayo.edu
Mon Jan 24 15:27:25 CET 2011

> What is the meaning of offset?

  As in glm() an offset is a variable on the right hand side of the
equation that is a fixed part of the predictor.  When doing linear
regression, or rpart with continuous Y, there is no need for an offset;
adding +offset(x3) on the right hand side of the equation gives the same
result as (y -x3) on the left.  But when y is a classification variable
this is not so.  
   I am blanking on the reference, but there has been a paper in the
last 2 years that did this nicely.  The response was a yes/no variable
and there were both continuous predictors like age that were best
handled with a logistic model, and genotype ones for which rpart was
desired.  The author fit the logistic and used the resulting linear
predictor as on offset in rpart, then used the genotype classes found in
rpart as an offset in the logistic, ...., back and forth, with
convergence in 2-3 iterations.

Terry Therneau

More information about the R-help mailing list