cross-sectional differencing with panel data
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
cross-sectional differencing with panel data
I'm using Eviews 7 and I have my data in panel form. I would like to know if there is an easy way to take cross-sectional differences, i.e. x(t,i)-x(t,j), i<>j, or even better, combine time-series differencing with cross-sectional differencing, x(t,i)-x(t-1,j). Using indirect referencing, for example x(t,i)-@meansby(x,t,j), is computationally heavy.
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: cross-sectional differencing with panel data
Before I write this one up, I want to make certain that I understand what you want to do. Is j fixed for all t in this setting (e.g., all cross-sections are differenced relative to a base cross-section for each period)? So the reference cross-section gets zeroed out while all others are in deviations from the base for each period?
Re: cross-sectional differencing with panel data
No, j is fixed for each i. In other words, j depends on i characteristics and stays the same for each i through the data period.
Take euro-area interest rates as an example: I wouldn't be interested in the evolution of yield spreads between Germany and other euro countries, but yield spreads between each euro area country, where the suitable benchmark interest rate is chosen according to, say, country fiscal characteristics.
Take euro-area interest rates as an example: I wouldn't be interested in the evolution of yield spreads between Germany and other euro countries, but yield spreads between each euro area country, where the suitable benchmark interest rate is chosen according to, say, country fiscal characteristics.
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: cross-sectional differencing with panel data
Okay, you lost me. Perhaps I'm being a bit slow this morning so bear with me...
Say you have three countries, C1, C2, and C3 observed over T periods each. We index the countries by i=1,2,3.
You say that the reference country j is "fixed" for each i, and "stays the same for each i through the data period". I don't quite know what you mean by "stays the same for each i" since that implies that everyone has the same reference country. But given your comments, I can only interpret this to mean that each country i is differenced relative to a reference country j which is the same for all *t*, and that the identity of j the depends on characteristics of i. Thus one possible outcome is that C2 is C1's reference country and C2 is C3's j and C1 is C2's.
If this is the case, then all we need to know is for you to describe in greater detail the rule for how the reference country is chosen for a given country.
Or I could still be way off on what you are trying to do.
:)
Say you have three countries, C1, C2, and C3 observed over T periods each. We index the countries by i=1,2,3.
You say that the reference country j is "fixed" for each i, and "stays the same for each i through the data period". I don't quite know what you mean by "stays the same for each i" since that implies that everyone has the same reference country. But given your comments, I can only interpret this to mean that each country i is differenced relative to a reference country j which is the same for all *t*, and that the identity of j the depends on characteristics of i. Thus one possible outcome is that C2 is C1's reference country and C2 is C3's j and C1 is C2's.
If this is the case, then all we need to know is for you to describe in greater detail the rule for how the reference country is chosen for a given country.
Or I could still be way off on what you are trying to do.
:)
Re: cross-sectional differencing with panel data
Ach so,
"each country i is differenced relative to a reference country j which is the same for all *t*, and that the identity of j the depends on characteristics of i" is indeed what I mean, thanks for setting it straight. I would prefer that the identity of the benchmark country is defined using logical operators. For example,
interest rate (Denmark, t) - interest rate[any country (excluding Denmark) with gdp/debt > 0.9*Denmark gdp/debt AND in_EMU=1,t]
in above example, the benchmark country may change within the data period, and its ok. I would like to know, however, how to keep it fixed (say, based on t=0 values) as well.
Many thanks,
jusi
"each country i is differenced relative to a reference country j which is the same for all *t*, and that the identity of j the depends on characteristics of i" is indeed what I mean, thanks for setting it straight. I would prefer that the identity of the benchmark country is defined using logical operators. For example,
interest rate (Denmark, t) - interest rate[any country (excluding Denmark) with gdp/debt > 0.9*Denmark gdp/debt AND in_EMU=1,t]
in above example, the benchmark country may change within the data period, and its ok. I would like to know, however, how to keep it fixed (say, based on t=0 values) as well.
Many thanks,
jusi
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: cross-sectional differencing with panel data
Okay, we're getting close, but the particulars of your example are still beyond my ability to comprehend. In particular, what I don't understand is the fact that there may be more than one country meeting the .9 and in_EMU criteria. (I'm also assuming that there are t subscripts on the remaining variables, even though you don't provide them.) So unless you are creating multiple series or contracting across the series that satisfy the condition I'm not sure how to think about computing that difference. How do you want to handle the multiples?
Because you are explicitly excluding the own country, I have a feeling we'll have to do this with a loop over countries, but I'll know better when I get more information about what you are doing.
Perhaps if you defined a set of specific series and a set of specific calculations you wish to perform we could nail this down.
Suppose we have INTEREST as the interest rate series and GDPDEBT and INEMU as the other series that are stacked by country in a panel structure. What exactly do you want to compute for Denmark and what do you want to compute for, say Germany, and France..?
Because you are explicitly excluding the own country, I have a feeling we'll have to do this with a loop over countries, but I'll know better when I get more information about what you are doing.
Perhaps if you defined a set of specific series and a set of specific calculations you wish to perform we could nail this down.
Suppose we have INTEREST as the interest rate series and GDPDEBT and INEMU as the other series that are stacked by country in a panel structure. What exactly do you want to compute for Denmark and what do you want to compute for, say Germany, and France..?
Re: cross-sectional differencing with panel data
Hi,
I have a cross-sectional data set for 1991, 1993, 1995 and 1997?
Can I use eviews to compare them over time, similar to panel data?
Do I select an unstructured/undated workfile?
For example:
1991
State 1
State 2
State 3
State 4
1993
State 1
State 2
State 3
State 4
1995
State 1
State 2
State 3
State 4
1997
State 1
State 2
State 3
State 4
Many Thanks
I have a cross-sectional data set for 1991, 1993, 1995 and 1997?
Can I use eviews to compare them over time, similar to panel data?
Do I select an unstructured/undated workfile?
For example:
1991
State 1
State 2
State 3
State 4
1993
State 1
State 2
State 3
State 4
1995
State 1
State 2
State 3
State 4
1997
State 1
State 2
State 3
State 4
Many Thanks
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: cross-sectional differencing with panel data
This is a bit vague. Are State1 in 1991 and State1 in 1993 the same state?
Re: cross-sectional differencing with panel data
Yes State 1 in 1991 is the same as State 1 in 1993, 1995, 1997 and so on.
Many Thanks
Many Thanks
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: cross-sectional differencing with panel data
So I'm semi-officially confused. You should be able to structure this as a panel and then perform various forms of analysis.
What do you mean "compare over time"?
What do you mean "compare over time"?
Re: cross-sectional differencing with panel data
Sorry for the confusion.
I was told that it is not panel data, as the same individuals are not surveyed each year and you cannot therefore track the same individuals through time. I'm not sure if this is true?
I wanted to run a regression including the different years and so I would have 16 observations in total.
Thanks
I was told that it is not panel data, as the same individuals are not surveyed each year and you cannot therefore track the same individuals through time. I'm not sure if this is true?
I wanted to run a regression including the different years and so I would have 16 observations in total.
Thanks
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: cross-sectional differencing with panel data
Wait. I'm even more confused.
You have 16 total observations? And you simply want to run a regression using all of them? If so, then just use unstructured. If no, them I really don't understand what's going on :)
You have 16 total observations? And you simply want to run a regression using all of them? If so, then just use unstructured. If no, them I really don't understand what's going on :)
Who is online
Users browsing this forum: paues and 2 guests
