Skip to content
Back to formatted view

Raw Message

Message-ID: <21958252.post@talk.nabble.com>
Date: 2009-02-11T16:43:05Z
From: Johannes Habel
Subject: How to count number of year per firm in panel data?

Hello,

I have an unbalanced panel dataset and would like to exclude all objects
that don't appear at least x times.

Therefore, I would like to include a column indicating for every line how
many periods are available, e.g.

id, year, number
1, 2000, 3
1, 2001, 3
1, 2002, 3
2, 2001, 1
3, ..., ...

This would allow me to exclude companies by setting "subset=number>=x".
However, I don't know how to create this column, i.e. how to count the years
for each object and include the numbers into the dataset.

Could anybody help me, please?

Alternatively, is there an easier way to achieve my goal?

Thank you very much.

Johannes Habel
-- 
View this message in context: http://www.nabble.com/How-to-count-number-of-year-per-firm-in-panel-data--tp21958252p21958252.html
Sent from the R help mailing list archive at Nabble.com.