# [R] Time Series Count Models

Paul Johnson pauljohn at ku.edu
Tue Jul 19 00:48:02 CEST 2005

```Dear Brett:

There are books for this topic that are more narrowly tailored to your
question. Lindsey's Models for Repeated Measurements and Diggle, et al's
Analysis of Longitudinal Data.  Lindsey offers an R package on his web
site. If you dig around, you will find many modeling papers on this,
although in my mind none coalesced into a completely clear path such as
"throw in these variables and you will get the right estimates".

The problem, as you will see, is that there are many possible
mathematical descriptions of the idea that there is time dependence in a
count model.

My political science colleagues John Williams and Pat Brandt published 2
articles on time series with counts.  My favorite is the second one
here.  There is R code for the Pests model.
http://www.utdallas.edu/~pbrandt/pests/pests.htm

Brandt, Patrick T., John T. Williams, Benjamin O. Fordham and Brian
Pollins. 2000. "Dynamic Modelling For Persistent Event Count Time
Series." American Journal of Political Science 44(4): 823-843.

Brandt, Patrick T. and John T. Williams. 2001. "A Linear Poisson
Autoregressive Model: the Poisson AR(p) Model." Political Analysis 9(2):
164-184.

I worked really hard on TS counts a while ago because a student was
trying that.  If you look at J Lindsay's book Models for Repeated
Measures you will make some progress on understanding his method
kalcount. That's in the repeated library you get from his web site.

Here are the notes I made a couple of years ago

http://lark.cc.ku.edu/~pauljohn/stats/TimeSeries/

Look for files called TSCountData*.pdf.

It all boils down to the fact that you can't just act like it is an OLS
model and throw Y_t-1 or something like that on the right had side.
Instead, you have to think in a more delicate way about the process you
are modeling and hit it from that other direction.

Here are some of the articles for which I kept copies.

U. Bokenholt, "Mixed INAR(1) Poisson regression models" Journal of
Econometrics, 89 (1999): 317-338

A.C. Harvey and C. Fernandes, "Time Series Models for Count or
Qualitative Observations, " Journal of Business & Economic Statistics, 4
(1989): 407-

I recall liking this one a lot

J E Kelsall and Scott Zeger and J M Samet "Frequency Domain Log-linear
Models; air pollution and mortality" Appl. Statis 48 1999 331-344.

Good luck, let me know what you find out.

pj

Brett Gordon wrote:
> Hello,
>
> I'm trying to model the entry of certain firms into a larger number of
> distinct markets over time. I have a short time series, but a large
> cross section (small T, big N).
>
> I have both time varying and non-time varying variables. Additionally,
> since I'm modeling entry of firms, it seems like the number of
> existing firms in the market at time t should depend on the number of
> firms at (t-1), so I would like to include the lagged cumulative count.
>
> My basic question is whether it is appropriate (in a statistical
> sense) to include both the time varying variables and the lagged
> cumulative count variable. The lagged count aside, I know there are
> standard extensions to count models to handle time series. However,
> I'm not sure if anything changes when lagged values of the cumulative
> dependent variable are added (i.e. are the regular standard errors
> correct, are estimates consistent, etc....).
>
> Can I still use one of the time series count models while including
> this lagged cumulative value?
>
> I would greatly appreciate it if anyone can direct me to relevant
> material on this. As a note, I have already looked at Cameron and
> Trivedi's book.
>
> Many thanks,
>
> Brett
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help

--
Paul E. Johnson                       email: pauljohn at ku.edu
Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
1541 Lilac Lane, Rm 504
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700

```