[R] Poisson Regression

Michael Friendly friendly at yorku.ca
Thu Oct 14 14:55:44 CEST 2010


On 10/13/2010 4:50 PM, Antonio Paredes wrote:
> Hello everyone,
>
> I wanted to ask if there is an R-package to fit the following Poisson
> regression model
>
> log(\lambda_{ijk}) = \phi_{i} + \alpha_{j} + \beta_{k}
> i=1,\cdots,N (subjects)
> j=0,1 (two levels)
> k=0,1 (two levels)
>
> treating the \phi_{i} as nuinsance parameters.
>
> Thank you very much

You can use the gnm() function in the gnm package with eliminate= to get 
rid of parameters for each subject.
Something like

gnm( lambda ~ Row + Col, eliminate = Subject, family=poisson, data=myData)

where Row, Col, Subject are suitable *factors*.  This is equivalent to

gnm( lambda ~ -1 + Subject Row + Col, family=poisson)
except that Subject parameters aren't estimated explicitly.  See 
vignette("gnmOverview")


-- 
Michael Friendly     Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University      Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street    Web:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA



More information about the R-help mailing list