Re: [R] change lm log(x) to glm poisson

2012-10-30 Thread Elaine Kuo
Hello, Thanks for the book list. Some are added. - Faraway. 2006. Extending the Linear Model With R: Generalized Linear, Mixed Effects and Nonparametric Regression Models (Texts in Statistical Science). - Venables and Ripley. 2002. Modern Applied Statistics with S (4th ed.). (Chapt

Re: [R] change lm log(x) to glm poisson

2012-10-28 Thread Mark Leeds
Hi Josh and Elaine: John Fox's CAR book ( the companion to his applied regression text ) is really great for implementing GLMs in R. It also has a brief but quality discussion of the theory behind them. His text goes into more detail. Dobson's "Introduction to generalized linear models" is also de

Re: [R] change lm log(x) to glm poisson

2012-10-28 Thread Joshua Wiley
Hi Elaine, If you want identical models, you need to use the same family and then the formula is the same. Here is an example with a built in dataset: ## these two are identical > coef(lm(mpg ~ hp + log(wt), data = mtcars)) (Intercept) hp log(wt) 38.86095585 -0.02808968 -13.06

[R] change lm log(x) to glm poisson

2012-10-28 Thread Elaine Kuo
Hello list, I am running a regression using lm(Y~A+B+log(C)+log(D)) Now, I would like to test if glm can produce similar results. So the code was revised as glm(Y~A+B+C+D, family=poisson) (code 1) However, I found some example using glm for lm. It suggests that the code should be revised lik