gmm estimate for different countries

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Alexf
Posts: 2
Joined: Sun Oct 13, 2013 11:52 pm

gmm estimate for different countries

Postby Alexf » Mon Oct 14, 2013 2:46 am

Hi,

I’m writing my first program and I have some difficulties with a very simple thing.
I want to run a gmm regression for different countries: us uk eu15 eu17 jp ger au .

I set my gmm equation and I would like to obtain different gmm estimate , one for each country . I have a list of series ,in this case labs and infl, for all these countries. The program I wrote always run the same regession with the same instruments for only one country ( it iterates several times only the same gmm equation for au(Australia)). I wrote

Code: Select all

open ppp.wf1 [color=#FFFF00]smpl 1960:1 2013:3 For %j a au sw us uk sp it eu15 eu17 cn nd fn jp ger genr infl{%j}=400*log(cp{%j}/cp{%j}(-1)) genr inflpd{%j}=400*log(ipd{%j}/ipd{%j}(-1)) next for %k1 us uk eu15 eu17 jp ger au for %countries us uk eu15 eu17 jp ger au genr infl{%k1}=400*log(cp{%k1}/cp{%k1}(-1)) genr labs{%k1}=(ulc{%k1}/ipd{%k1})*0.123 labs{%k1}.hpf(lambda=1600) labs{%k1}_hp series labs{%k1}_c = labs{%k1} - labs{%k1}_hp equation {%countries}.gmm(method=converge, instwgt=HAC,instinfo=SIC,deriv=aa) infl{%k1} c infl{%k1}(+1) infl{%k1}(-1) labs{%k1}_c@ infl{%k1}(-2) infl{%k1}(-3) infl{%k1}(-4) infl{%k1}(-5) labs{%k1}_c(-1) labs{%k1}_c(-2) labs{%k1}_c(-3) labs{%k1}_c(-4) {%countries}.weakinst next next [/color]
What is wrong in the program?

I have to do a Bai- Perron test also. I did the “add in” for my eviews 7.1 and the test works for each single series for each single country , but how to make the program run it?

Thanks so much in advance for any kind of help!!
Attachments
ppp.wf1
(204.28 KiB) Downloaded 143 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: gmm estimate for different countries

Postby EViews Gareth » Mon Oct 14, 2013 10:27 am

You don't need the %countries loop and the %k loop. They are the same loop. Remove the %countries loop, and then call your equation eq_{%k}

Alexf
Posts: 2
Joined: Sun Oct 13, 2013 11:52 pm

Re: gmm estimate for different countries

Postby Alexf » Tue Oct 22, 2013 8:55 am

I'm a little bit late but thanks so much Gareth.

I have an other question: how can I perform a bai-perron test for each ols equation in eviews 7.1?
If I write

Code: Select all

For %j a sd us uk it eu15 cn nd fn jp ger equation eq0_{%j}.ls inflpd{%j} c inflpd{%j}(-1) eq0_{%j}.baiperron next
I only get a bai-perron test table for the first country.
What is again wrong?
I would be very grateful for any feedback you might be able to give me
In any case, thanks again for your answer!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests