# Panel data

In statistics and econometrics, the term panel data refers to multi-dimensional data frequently involving measurements over time. Panel data contain observations of multiple phenomena obtained over multiple time periods for the same firms or individuals. In biostatistics, the term longitudinal data is often used instead,[1][2] wherein a subject or cluster constitutes a panel member or individual in a longitudinal study.

Time series and cross-sectional data are special cases of panel data that are in one dimension only (one panel member or individual for the former, one time point for the latter).

## Example

balanced panel: unbalanced panel:
$\begin{matrix} \mathrm{person} & \mathrm{year} & \mathrm{income} & \mathrm{age} & \mathrm{sex}\\ 1 & 2001 & 1300 & 27 & 1 \\ 1 & 2002 & 1600 & 28 & 1 \\ 1 & 2003 & 2000 & 29 & 1 \\ 2 & 2001 & 2000 & 38 & 2 \\ 2 & 2002 & 2300 & 39 & 2 \\ 2 & 2003 & 2400 & 40 & 2 \end{matrix}$ $\begin{matrix} \mathrm{person} & \mathrm{year} & \mathrm{income} & \mathrm{age} & \mathrm{sex}\\ 1 & 2001 & 1600 & 23 & 1 \\ 1 & 2002 & 1500 & 24 & 1 \\ 2 & 2001 & 1900 & 41 & 2 \\ 2 & 2002 & 2000 & 42 & 2 \\ 2 & 2003 & 2100 & 43 & 2 \\ 3 & 2002 & 3300 & 34 & 1 \end{matrix}$

In the example above, two data sets with a two-dimensional panel structure are shown, although the second data set might be a three-dimensional structure since it has three people. Individual characteristics (income, age, sex. educ) are collected for different persons and different years. In the left data set two persons (1, 2) are observed over three years (2001, 2002, 2003). Because each person is observed every year, the left-hand data set is called a balanced panel, whereas the data set on the right hand is called an unbalanced panel, since Person 1 is not observed in year 2003 and Person 3 is not observed in 2003 or 2001.

## Analysis of panel data

A panel has the form

$X_{it}, \; i = 1, \dots, N \; t = 1, \dots, T,$
where $i$ is the individual dimension and $t$ is the time dimension. A general panel data regression model is written as $y_{it} = \alpha + \beta' X_{it} + u_{it}.$ Different assumptions can be made on the precise structure of this general model. Two important models are the fixed effects model and the random effects model. The fixed effects model is denoted as

$y_{it} = \alpha + \beta' X_{it} + u_{it},$
$u_{it} = \mu_i + \nu_{it}.$

$\mu_i$ are individual-specific, time-invariant effects (for example in a panel of countries this could include geography, climate etc.) and because we assume they are fixed over time, this is called the fixed-effects model. The random effects model assumes in addition that

$\mu_i \sim \text{i.i.d.} N(0, \sigma^2_{\mu})$

and

$\nu_{it} \sim \text{i.i.d.} N(0, \sigma^2_{\nu}),$

that is, the two error components are independent from each other.