# How to correctly fill in missing values in panel data?

So, I have panel data that look like this:

The data that are missing, is because we were not able to find full data in the annual reports of the banks listed in the dataset. There is no real pattern for missing values, apart from some periods as the one illustrated in the image, the missing values are mostly random. For example, one missing value in 2000, other missing value in 2002, and so on. The banks are five in total, and we include quarterly data for the period 1998Q1 to 2013Q1.

We have a full series for one of the variables, beta. The other four are all missing some values.

    Variable |       Obs
-------------+--------------
beta |       305
leverage |       290
roa |       283
r_rwa |       277
rwa_assets |       277


I have searched, but haven't been able to get an answer to the following questions:

1) Is it important that my dataset has missing values in some of the variables?

2) What is the right method to use for filling in those missing values? If it's possible, can you illustrate it using Stata?

• Questions largely about use of Stata for data management are arguably off-topic here. You are much better off asking this kind of thing on Statalist. But pay attention please to stata.com/support/faqs/resources/statalist-faq/#crossposting – Nick Cox Jul 26 '13 at 19:23
• @Nick This question is explicitly about imputing missing data and therefore is squarely on-topic on this site. Herman: we do, however, encourage people to ask questions in a more software-neutral way: instead of asking "how do I do X in Stata," consider asking "how do I do X...and if you're able, please illustrate your answer with Stata." That opens your question to far more experts (most of whom do not use Stata), greatly increasing the chance you will get a good answer. – whuber Jul 26 '13 at 20:14
• OK, thank you @whuber, I'll do as you suggest from now on. I agree with you, even though I ask how to do it in Stata, the core of the question is what is the correct way to do it, because I know there are lots of ways of filling in gaps, but I would like to know what is the best way to do it. – Herman Haugland Jul 26 '13 at 20:19

I doubt there is agreement on a single "right" method here. Given the panel character of the data, you could try anything from numerical interpolation to multiple imputation. Interpolation could use ipolate (official Stata), cipolate (SSC), csipolate (SSC), pchipolate (SSC), nnipolate (SSC). Interpolation will inevitably not restore all the variability lost. Multiple imputation is supported by the very extensive mi suite, but taking account of both cross-sectional and time dependencies is challenging.
• I'm not a stata expert, unfortunately, but I know that R has a robust set of packages supporting imputation for time series-cross-sectional data. Amelia II especially comes to mind, as it was built for this explicit purpose. – Sycorax Nov 14 '14 at 19:40