*Use of count data*

Longitudinal count data is a special type of longitudinal data that can take only nonnegative integer values {0, 1, 2, …} that come from counting something, e.g., the number of seizures, hemorrhages or lesions in each given time period. In this context, data from individual *i *is the sequence where is the number of events observed in the *j*th time interval .

Count data models can also be used for modeling other types of data such as the number of trials required for completing a given task or the number of successes (or failures) during some exercise. Here, is either the number of trials or successes (or failures) for subject *i* at time . For any of these data types we will then model as a sequence of random variables that take their values in {0, 1, 2, …}. If we assume that they are independent, then the model is completely defined by the *probability mass functions* for and . Here, we will consider only parametric distributions for count data.

*Observation model syntax*

Considering the observations as a sequence of conditionally independent random variables, the model is completely defined by the probability mass functions . An observation variable for count data is defined using the type count. Its additional field is:

- P(Y=k): Probability of a given count value k, for the observation named Y. k is a natural number. A transformed probability can be provided instead of a direct one. The transformation can be log, logit, or probit. The bounded variable k supersedes in this scope any predefined variable k.

*Example*

In the proposed example, the Poisson distribution is used for defining the distribution of :

where the Poisson intensity is function of time . This model is implemented as follows

[LONGITUDINAL] input = {a,b} EQUATION: lambda = a+b*t DEFINITION: y = {type=count, P(y=k) = exp(-lambda)*(lambda^k)/factorial(k)}