i have fitted a Poisson regression to my claim frequency data. my predictor is make of vehicle.  I have obtained the following result:  Coefficients:               Estimate  Std. Error  z value Pr(&gt;|z|)   (Intercept)  -19.99774  1138.82118  -0.018  0.98599   make2         -0.30873    0.20550  -1.502   0.13302  make3         -0.39177    0.21129  -1.854   0.06372  make4         -0.38375    0.13388  -2.866   0.00415 **   How do I interpret the negative coefficients? Thanks
119289
How can I interpret the main effects (coefficients for dummy-coded factor) in a Poisson regression?  Assume the following example:  treatment     &lt;- factor(rep(c(1, 2), c(43, 41)),                          levels = c(1, 2),                         labels = c("placebo", "treated")) improved      &lt;- factor(rep(c(1, 2, 3, 1, 2, 3), c(29, 7, 7, 13, 7, 21)),                         levels = c(1, 2, 3),                         labels = c("none", "some", "marked"))     numberofdrugs &lt;- rpois(84, 10) + 1     healthvalue   &lt;- rpois(84, 5)    y             &lt;- data.frame(healthvalue, numberofdrugs, treatment, improved) test          &lt;- glm(healthvalue~numberofdrugs+treatment+improved, y, family=poisson) summary(test)   The output is:  Coefficients:                  Estimate Std. Error z value Pr(&gt;|z|)     (Intercept)       1.88955    0.19243   9.819   &lt;2e-16 *** numberofdrugs    -0.02303    0.01624  -1.418    0.156     treatmenttreated -0.01271    0.10861  -0.117    0.907   MAIN EFFECT   improvedsome     -0.13541    0.14674  -0.923    0.356   MAIN EFFECT  improvedmarke    -0.10839    0.12212  -0.888    0.375   MAIN EFFECT  --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1    I know that the incident rate for numberofdrugs is exp(-0.023)=0.977. But how do I interpret the main effects for the dummy variables?
21645
the point represents rates like 10%, etc. (this was also pretty clear from 2 years ago) -- been trying to do this for 2 yrs...  the points dont represent numbers of events since they are rates ()    but the points have geo ids so they are attached to location, not distance (whatever distance is to imply) -- update: it represents z-value but we're just dealing with rates
11290
"Assume independent random variables $Y_i$~$Poisson(λx_i)$. Supposing that $x_i$ are given, fixed constants, obtain the least squares estimator of $λ$ and compute its variance."  This kind of a problem is the first one faced by me. The first things that are coming to my mind are regression equation of the form $log(Y)=a+bx$ and then trying the least square algorithm by minimizing $∑(log(y)-a-bx)^2$. From this I will be getting the least squares estimates of $a,b$ but how do I get $λ$?  As I said, this is the first time I am facing such a question. I know point estimation in terms of MLE and moment-equality. I need help and resources (i.e. more knowledge) about solving this kind of a question. Can you kindly supply me with the answer and the explanation along with maybe links to some pdf's? Google is not helping me. Thanks in advance.  (EDIT:) While I was waiting for any response to this question, I looked up deeper and found that I did not know one information. That is, the least square estimator for a parameter $θ$ is obtained by minimising $∑(Y_i-E(Y_i|x_i,θ))^2$. So I tried to work on this using my new knowledge.  I get the LSE of $λ$ as $\dfrac{∑x_iY_i}{∑(x_i)^2}$. Please tell me if this is correct.  Then the variance of this LSE is $\dfrac{λ∑(x_i)^3}{(∑(x_i)^2)^2}$.   Is this right? Thanks for your time.
50690
I am writing an algorithm where, given a model, I compute likelihoods for a list of datasets and then need to normalize (to probability) each one of the likelihood. So something like [0.00043, 0.00004, 0.00321] might be converted to may be like [0.2, 0.03, 0.77].   My problem is that the log likelihoods, I am working with, are quite small (for instance, in log space, the values are like -269647.432, -231444.981 etc). In my C++ code, when I try to add two of them (by taking their exponent) I get an answer of "Inf". I tried to add them in log-space , but again stumbled upon the same problem.  Can anybody share his/her expert opinion on this?
109027
The zero inflated Poisson regression model is defined for a sample $(y_1,\ldots,y_n)$ by $$ Y_i = \begin{cases} 0 &amp; \text{with probability} \ p_i+(1-p_i)e^{-\lambda_i}\\ k &amp; \text{with probability} \ (1-p_i)e^{-\lambda_i} \lambda_{i}^{k}/k! \end{cases}$$ and it further assumes that the parameters $\mathbf{\lambda} = (\lambda_1, \dots, \lambda_n)$ and $\textbf{p} = (p_1, \dots, p_n)$ satisfy   $$\eqalign{ \log(\mathbf{\lambda}) &amp;= \textbf{B} \beta \\ \text{logit}(\textbf{p}) &amp;= \log(\textbf{p}/(1-\textbf{p})) = \textbf{G} \mathbf{\gamma}. }$$  The corresponding log likelihood of the zero-inflated Poisson regression model is  $$\eqalign{ L(\gamma,\mathbf{\beta}; \mathbf{y}) &amp;= \sum_{y_i=0} \log(e^{G_i \gamma}+\exp(-e^{\textbf{B}_i \mathbf{\beta}})) +\sum_{y_i &gt;0} (y_i \textbf{B}_i \mathbf{\beta}-e^{\textbf{B}_i \mathbf{\beta}})\\ &amp;\quad -\sum_{i=1}^{n} \log(1+e^{G_{i} \gamma})-\sum_{y_i &gt;0} \log(y_{i}!)}$$  Here, $\mathrm{B}$ and $\mathrm{G}$ are the design matrices. These matrices could be the same, depending on the features one desires to use for the two generating processes. They have the same number of rows, however.  Assuming that we could observe $Z_i = 1$ when $Y_i$ is from the perfect, zero state and $Z_i = 0$ when $Y_i$ is from the Poisson state the log-likelihood would be   $$L(\gamma,\mathbf{\beta}; \mathbf{y}, \mathbf{z}) = \sum_{i=1}^{n} \log(f(z_i|\mathbf{\gamma}))+\sum_{i=1}^{n} \log(f(y_i|z_i, \mathbf{\beta}))$$  $$ = \sum_{i=1}^{n} z_{i} (\textbf{G}_i \gamma-\log(1+e^{G_{i} \gamma}))+ -\sum_{i=1}^{n} (1-z_{i})\log(1+e^{G_{i} \gamma})+ \sum_{i=1}^{n} (1-z_i)[y_{i} \textbf{B}_i \beta-e^{\textbf{B}_i \beta} - \log(y_{i}!)]$$ The first two terms are the loss in a logistic regression to separate $z_i=0$ from $z_i=1$. The second term is a regression to the points generated by the Poisson process.  But aren't latent variables unobservable? The purpose is to maximize the first log-likelihood. But we have to introduce latent variables and derive a new log-likelihood. Then using the EM algorithm, we can maximize the second log-likelihood. But this assumes that we know that either $Z_i = 0$ or $Z_i = 1$?
49976
I've often seen the advice for checking whether or not a Poisson model fit is over-dispersed involving dividing the residual deviance by the degrees of freedom. The resulting ratio should be "approximately 1".  The question is what range are we talking about for "approximate" - what is a ratio that should set off alarms to go consider alternative model forms?
33007
I have count data (demand/offer analysis with counting number of customers, depending on - possibly - many factors). I tried a linear regression with normal errors, but my QQ-plot is not really good. I tried a log transformation of the answer: once again, bad QQ-plot.  So now, I'm trying a regression with Poisson Errors. With a model with all significant variables, I get:  Null deviance: 12593.2  on 53  degrees of freedom Residual deviance:  1161.3  on 37  degrees of freedom AIC: 1573.7  Number of Fisher Scoring iterations: 5   Residual deviance is larger than residual degrees of freedom: I have overdispersion.  How can I know if I need to use quasipoisson? What's the goal of quasipoisson in this case? I read this advise in "The R Book" by Crawley, but I don't see the point nor a large improvement in my case.
118922
Recently, I was asked to check for serial correlation after doing a panel Poisson regression. I haven't seen such a test and in general, researchers (at least in the econom(etr)ics literature) don't report many diagnostics.   There is some discussion going on on this forum about the nature of residuals from a Poisson regression (see for example ,  and ), specifically about the questions 1) whether residuals should normally distributed, and 2) if not, what their theoretical distribution is. My understanding so far is: 1) no, and 2) it's complicated.   Am I correct in thinking that the distribution of residuals for panel Poisson analysis is also complicated, probably more so than for cross-section; and that because of that, there simply are not as many formal diagnostic tests as for linear models?  (My immediate question is about serial correlation in panel Poisson models, but I would be interested in a more general discussion for Poisson models, non-linear models and other diagnostics than serial correlation)
58523
I want to be able to calculate the confidence interval from the estimated coefficient and respective standard errors.  I have a linear regression model which can be summarized (in R):  summary(fit1)  Call: lm(formula = bwt ~ height + weight + parity, data = data)  Residuals:     Min      1Q  Median      3Q     Max  -66.913 -10.624   0.991  10.979  55.621   Coefficients:             Estimate Std. Error t value Pr(&gt;|t|)     (Intercept) 31.19217   13.56879   2.299   0.0217 *   height       1.24964    0.23083   5.414 7.48e-08 *** weight       0.06781    0.02823   2.402   0.0164 *   parity1     -1.83309    1.19838  -1.530   0.1264     --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  Residual standard error: 17.9 on 1170 degrees of freedom Multiple R-squared:  0.04898,   Adjusted R-squared:  0.04654  F-statistic: 20.08 on 3 and 1170 DF,  p-value: 1.071e-12   With this model I can calculate the respective confidence intervals:  &gt; confint(fit1)                   2.5 %     97.5 % (Intercept)  4.57029503 57.8140351 height       0.79676227  1.7025207 weight       0.01243198  0.1231932 parity1     -4.18429933  0.5181151   I would expect the intervals of the predictor height to be given by  $$ 1.24964 \pm (1.96*0.23083) = [0.7972132,1.702067] $$  where 1.24964 is the estimated value for the coefficient and 0.23083 is the standard error for this coefficient. The numbers are close but not quite the same.  What am I doing wrong?
118775
Im analysing count data (number of clinic visits) when I test for poisson distribution using 1 sample KS test in spss the sig is &lt;0.05( meaning it doesnt follow poisson distribution ) it does not follow normal distribution either,  no values of zero, the values are either 1,2,3,or 5, what can I do
88429
I thought I figured out this problem, but my answer is different than the solutions manual. Hoping someone here can stear me in the correct direction:     Assume the number of automobile collisions that occur on a given stretch of highway per year is a Poisson random variable $X$ with $\mu = 20$. The probability is $p=0.05$ that there will be one or more fatalities in each accident; occurrences of fatalities are independent from one collision to the next. If $Y$ is the number of collisions with one or more fatalities on this stretch of road in one year, find the probability law for $Y$.   So as said, X is poisson, so:  $$p_X(x) = \frac{20^x}{x!}e^{-20}$$  The conditional probability of $Y$ given $X=x$ is a Binomial random variable:  $$p_{Y\mid X}(y\mid x) = \binom{x}{y}p^yq^{x-y}$$  where $Y =$ number of fatal traffic accidents and $x =$ given number of accidents (from poisson distribution)  Therefore the joint probability for $X$ and $Y$ is:  $$p_{X,Y}(x,y)= p_{Y\mid X}\cdot p_X(x) = \binom{x}{y}p^yq^{x-y}\frac{20^x}{x!} e^{-20}$$  to find the marginal probability of $Y$, I sum over $P_{X,Y}$ for all $x$:  \begin{align} p_Y(y) &amp; = \sum_{x=y}^\infty{\binom{x}{y}p^yq^{x-y}\frac{20^x}{x!}e^{-20}} = \frac{(20p)^ye^{-20}}{y!} \sum_{x=y}^\infty {20^{x-y}\frac{q^{x-y}}{(x-y)!}} \\[10pt] &amp; = \frac{(20p)^ye^{-20}}{y!} \sum_{x-y=0}^\infty {20^{x-y}\frac{q^{x-y}}{(x-y)!}} = \frac{(20p)^ye^{-20}}{y!}e^{20q} \end{align}  So:   $$p_Y(y) = \frac{(20p)^ye^{-20p}}{y!}$$  however, the correct answer is apparently $p_Y(y)=\dfrac{e^{-1}}{y!}$
32439
I am regressing a continuous predictor on over 60 variables (both continuous and categorical) using LASSO (glmnet).  In examining the variable trace plot, I notice that as log lambda increases, one of the key variables has a coefficient that actually increases.  Then, after a certain point, it begins to decrease like we would expect.    To make sure this wasn't a fluke, I ran 10 models using bootstraps and obtained very similar results.    Is this possible, or is there a problem with the data?  If legitimate, what does this trend in the variable's coefficient tell us about the variable and the relation to the response?
83116
I have run the following logistic regression:  glm(formula = DecisionasReceiver ~ L1 + L2 + L3,    family = binomial("logit"), data = lue)   where L1 L2 and L3 code for differences in condition of no.GREEN. L1: 1,-1,0,0 : is there a difference in DecisionasReceiver as no.GREEN changes from 1 to 2?  L2: 0,1,-1,0: is there a difference in DecisionasReceiver as no.GREEN changes from 2 to 3?  L2: 0,0,1,-1: is there a difference in DecisionasReceiver as no.GREEN changes from 3 to 4?  And I'm running this regression both for the cases where MessageReceived is BLUE and for MessageReceived RED.   I have the following output:     Coefficients:       Estimate Std. Error z value Pr(&gt;|z|)     (Intercept)  -0.9535     0.3659  -2.606  0.00916 **  L1            2.2753     0.5406   4.209 2.56e-05 *** L2            3.1234     0.7318   4.268 1.97e-05 *** L3            1.9369     0.8134   2.381  0.01726 *     Looking at my graph it seems strange that the coefficients are positive and that the intercept is -0.953. How exactly should I interpret these results in the light of the graph?
19133
I recently discovered how to model exposures over time using the log of (e.g.) time as an offset in a Poisson regression.  I understood that the offset corresponds to having time as covariate with coefficient 1.  I'd like to better understand the difference between using time as an offset or as a normal covariate (therefore estimating the coefficient). In which situation should I want to use one method or the other?  UPGRADE: I don't know if it is interesting, but I ran a validation of the two methods using randomly split data repeated 500 times and I noticed that using the offset method leads to a larger test error.
37043
I understand that for certain datasets such as voting it performs better. Why is Poisson regression used over ordinary linear regression or logistic regression? What is the mathematical motivation for it?
102173
I built a ZI model and it is producing predicted values that are from a very small range when compared to the observed values. Plus it does not produce any zeros. See the fitted vs. observed graph below.     My model structure is given below. My response is a count variable and the predictor is continuous water level measurements (scaled).   m.u.meanwl.gu &lt;- zeroinfl(GU ~ MeanWLScaled | MeanWLScaled, data = uluabat_wl_fg, dist = "negbin", link = "logit")   I need help to figure out what's wrong and fix it. Thanks in advance.
78313
I am carrying out research to look at differences in fish density and fish species richness when using two different underwater visual census methods. My data was originally count data but then typically this is changed to fish density but I have still decided to use a Poisson GLM, which I hope is right.   model1 &lt;- glm(g_den ~ method + site + depth, poisson)   My 3 predictor variables are method, site and depth which I ordered as factors when I input them.   My response variables are grouper species richness, grouper density and the same for other fish groups. I am aware that density is not an integer and it is numerical data e.g 1.34849. I am now however getting this error:      In dpois(y, mu, log = TRUE) : non-integer x = 0.037500   I've been reading up and many people suggest using an offset, is this the most advisable thing to do?