Skip to content

R-beta: Various R Questions and Comments

3 messages · Doug Morse, Peter Dalgaard, Thomas Lumley

#
morse at pobox.com (Doug Morse) writes:
Whoops, sorry. That feature is glm only (I wonder why...). Basically:


glm(formula = Ozone ~ Day)

..
Coefficients:
               Value  Std.error  t value  P(>|t|)
(Intercept)  42.9039     6.2883   6.8228   0.0000
Day          -0.0499     0.3531  -0.1412   0.8879

glm(formula = Ozone ~ Day + offset(-Day/20))

..
Coefficients:
               Value  Std.error  t value  P(>|t|)
(Intercept)  42.9039     6.2883   6.8228   0.0000
Day           0.0001     0.3531   0.0004   0.9997


(lm() just silently disregards the offset term. Needs fixing, obviously...)
#
On Mon, 16 Feb 1998, Doug Morse wrote:
An offset is a term in the model with coefficient set at 1. There are all
sorts of uses, but one is exactly what you want: testing a coefficient
against a non-zero hypothesised value.

Unfortunately lm() doesn't implement offsets, but glm() does
Your two models are
	glm(Satisfaction~Age+Severity+Anxiety,family=gaussian())
	glm(Satisfaction~offset(-1.0*Age)+Anxiety,family=gaussian())
which could be compared with anova.glm (the family=gaussian()) option is
not necessary as it is the default)


Thomas Lumley

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._