markleeds at verizon.net
2008-Jul-14 20:47 UTC
[R] statistics question about a statement in julian faraway's "extending the linear model with R" text
In Julian Faraway's text on pgs 117-119, he gives a very nice, pretty simple description of how a glm can be thought of as linear model with non constant variance. I just didn't understand one of his statements on the top of 118. To quote : "We can use a similar idea to fit a GLM. Roughly speaking, we want to regress g(y) on X with weights inversely proportional to var(g(y). However, g(y) might not make sense in some cases - for example in the binomial GLM. So we linearize g(y) as follows: Let eta = g(mu) and mu = E(Y). Now do a one step expanation , blah, blah, blah. Could someone explain ( briefly is fine ) what he means by g(y) might not make sense in some cases - for example in the binomial GLM ? Thanks.
Greg Snow
2008-Jul-14 21:22 UTC
[R] statistics question about a statement in julian faraway's "extending the linear model with R" text
For the binomial the standard link function is the logit: g(y) = log( y/(1-y) ) In the binomial glm model the observed y values are 0, or 1 which give g(0) = -Inf and g(1) = Inf. Switching to g(mu) with 0 < mu < 1 results in finite values which are much easier for the computer to work with. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org (801) 408-8111> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of > markleeds at verizon.net > Sent: Monday, July 14, 2008 2:48 PM > To: r-help at stat.math.ethz.ch > Subject: [R] statistics question about a statement in julian > faraway's "extending the linear model with R" text > > In Julian Faraway's text on pgs 117-119, he gives a very > nice, pretty simple description of how a glm can be thought > of as linear model with non constant variance. I just didn't > understand one of his statements on the top of 118. To quote : > > "We can use a similar idea to fit a GLM. Roughly speaking, we > want to regress g(y) on X with weights inversely proportional > to var(g(y). However, g(y) might not make sense in some cases > - for example in the binomial GLM. So we linearize g(y) as > follows: Let eta = g(mu) and mu = E(Y). Now do a one step > expanation , blah, blah, blah. > > Could someone explain ( briefly is fine ) what he means by > g(y) might not make sense in some cases - for example in the > binomial GLM ? > > Thanks. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Duncan Murdoch
2008-Jul-14 21:24 UTC
[R] statistics question about a statement in julian faraway's "extending the linear model with R" text
markleeds at verizon.net wrote:> In Julian Faraway's text on pgs 117-119, he gives a very nice, pretty > simple description of how a glm can be thought of as linear model > with non constant variance. I just didn't understand one of his > statements on the top of 118. To quote : > > "We can use a similar idea to fit a GLM. Roughly speaking, we want to > regress g(y) on X with weights inversely proportional > to var(g(y). However, g(y) might not make sense in some cases - for > example in the binomial GLM. So we linearize g(y) > as follows: Let eta = g(mu) and mu = E(Y). Now do a one step expanation > , blah, blah, blah. > > Could someone explain ( briefly is fine ) what he means by g(y) might > not make sense in some cases - for example in the binomial > GLM ? >I don't know that text, but I'd guess he's talking about the fact that the expected value of a binomial must lie between 0 and N (or the expected value of X/N, where X is binomial from N trials, must lie between 0 and 1). Similarly, the expected value of a gamma or Poisson must be positive, etc. Duncan Murdoch
Peter Dalgaard
2008-Jul-14 21:35 UTC
[R] statistics question about a statement in julian faraway's "extending the linear model with R" text
markleeds at verizon.net wrote:> In Julian Faraway's text on pgs 117-119, he gives a very nice, pretty > simple description of how a glm can be thought of as linear model > with non constant variance. I just didn't understand one of his > statements on the top of 118. To quote : > > "We can use a similar idea to fit a GLM. Roughly speaking, we want to > regress g(y) on X with weights inversely proportional > to var(g(y). However, g(y) might not make sense in some cases - for > example in the binomial GLM. So we linearize g(y) > as follows: Let eta = g(mu) and mu = E(Y). Now do a one step > expanation , blah, blah, blah. > > Could someone explain ( briefly is fine ) what he means by g(y) might > not make sense in some cases - for example in the binomial > GLM ? >Note that he does say "roughly speaking". The intention is presumably that if y is a vector of proportions and g is the logit function, proportions can be zero or one, but then their logits would be minus or plus infinity. (However, that's not the only thing that goes wrong; the model for g(E(Y)) is linear, the expression for E(g(y)) in general is not.) -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907