Hi,
Does someone know how to do unit-specific time averages for panel data on Eviews?
Thanks,
Angie
Unit specific time averages
Moderators: EViews Gareth, EViews Moderator
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Unit specific time averages
You probably want the @meansby function with the date series as the by parameter.
Follow us on Twitter @IHSEViews
Re: Unit specific time averages
And how do I do that? Could you please explain that with steps cause I am new to panel data?
Re: Unit specific time averages
Can I also ask something else is there a way that I can make the random effect used instead of the fixed effects (so it passes the Hausman test), because random effects is the method to be used for my data?
Last edited by AngieL on Fri Aug 19, 2016 10:12 am, edited 1 time in total.
Re: Unit specific time averages
This is what I am trying to do on eviews but I can not seem to find the way to do it :
There are two ways of rescuing a random effects approach under correlation between the country specific error and the regressors. One is to do the Hausman-Taylor IV estimation but for that we would have to come up with possible instruments that are not correlated with ai, which does not seem an easy task. In this paper we will opt for a different approach that consists on modelling the error term ai. This approach, described in Wooldridge (2002), is usually applied when estimating non-linear models, as IV estimation proves to be a Herculean task but, as we shall see, the application to our case
is quite successful. The idea is to give an explicit expression for the correlation between the error and the regressors, stating that the expected value of the country specific error is a linear combination of time-averages of the regressors X i . This follows Hajivassiliou and Ioannides (2006) and Hajivassiliou (2006).
( i | it , i ) i E a X Z = η X . (2)
If we modify our initial equation (1), with i t i a =η X +ε we get
Xi it it i i it R = β X +λ Z +η +ε +μ , (3)
where εi is an error term by definition uncorrelated with the regressors. In practical terms, we eliminate the problem by including a time-average of the explanatory variables as additional time-invariant regressors.
There are two ways of rescuing a random effects approach under correlation between the country specific error and the regressors. One is to do the Hausman-Taylor IV estimation but for that we would have to come up with possible instruments that are not correlated with ai, which does not seem an easy task. In this paper we will opt for a different approach that consists on modelling the error term ai. This approach, described in Wooldridge (2002), is usually applied when estimating non-linear models, as IV estimation proves to be a Herculean task but, as we shall see, the application to our case
is quite successful. The idea is to give an explicit expression for the correlation between the error and the regressors, stating that the expected value of the country specific error is a linear combination of time-averages of the regressors X i . This follows Hajivassiliou and Ioannides (2006) and Hajivassiliou (2006).
( i | it , i ) i E a X Z = η X . (2)
If we modify our initial equation (1), with i t i a =η X +ε we get
Xi it it i i it R = β X +λ Z +η +ε +μ , (3)
where εi is an error term by definition uncorrelated with the regressors. In practical terms, we eliminate the problem by including a time-average of the explanatory variables as additional time-invariant regressors.
-
- EViews Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: Unit specific time averages
Code: Select all
series ymean = @meansby(y, @crossid)
computes, for each cross-section, the mean of Y taken across all of the time-periods and assigns that value to each observation in the cross-section.
@meansby function
Hi Glenn,
I have the below function that I used some time ago and now I am not sure what it calculates?
The function is:
Series A = (@meansby(Series X, Series Y, Series Z ,"2003 2018"))
It will be very helpful if someone can reply.
Regards
Masum
I have the below function that I used some time ago and now I am not sure what it calculates?
The function is:
Series A = (@meansby(Series X, Series Y, Series Z ,"2003 2018"))
It will be very helpful if someone can reply.
Regards
Masum
Return to “General Information and Tips and Tricks”
Who is online
Users browsing this forum: No registered users and 19 guests