Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: xtset problem: dublicate panel observations in timeperiods


From   [email protected]
To   [email protected]
Subject   st: xtset problem: dublicate panel observations in timeperiods
Date   Thu, 20 Jan 2011 10:10:12 +0100

Dear statalist.

I have panel data of organizations collaborating in unique projects that compete against each other on a monthly basis.
I want to estimate models that account for correlations from clustering by project, and/or alternatively correlations among multiple observations of same agency_id over time.

The problem is that some organizations sometimes partake in more than one project per month.
The dataset has the following structure:

agency_id     project_id     yearmonth     year     var_vector     performance
1             1              1             03                      1
2             1              1             03                      1
3             2              1             03                      0
4             3              2             03                      0
1             3              2             03                      0
1             4              2             03                      1
2             4              2             03                      1
 
I need to specify a panel and time variable. Ideally, I would like to specify agency_id and yearmonth.
But due to multiple observations of agency_id per yearmonth, agency_id by yearmonth is not a unique identifier.

If I use project_id as to timeset, I get a unique identifier, but then I lose the "competing by yearmonth" dimension.

Another alternative I have tried is to generate a panel variable z = project_id/agency_id and then set grouping by agency i(agency_id) when I estimate my models.
But then I can't seem to specify clustering within projects.

A third alternative is to remove dublicate observations of agency_id by yearmonth, but then I lose a lot fo information and variation. Not desirable.
Are there any tricks I have overlooked to solve this problem?

Any and all help is very much appreciated.

Sincerely,
Erik Aadland.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index