store Wald test value and se

For questions regarding programming in the EViews programming language.

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

shuchang
Posts: 29
Joined: Mon Oct 28, 2013 8:00 pm

store Wald test value and se

Postby shuchang » Thu Feb 02, 2017 2:39 pm

Dear Sir/Madam, I want to do rolling estimations of a fixed effects model in a pool object. I need to calculate the long run elasticity, and compute the confidence band. What I thought I would do is a Wald test, which will give the value and standard error. But how can I store the value and se from the Wald test for each rolling estimation, and store them into series for plotting? Or are there alternative ways in Eviews to obtaining standard errors for long run elasticity and easily store them so that they can be saved as rolling regression coefficient statistics?

So for example: in the attached file, I estimate this:

smpl 1994Q1 @last
p_ae.ls(cx=f) cpi? c cpi?(-1) ppi_inf?(0 to -3)
p_ae.wald c(3)/(1-c(2))=0

So I get the long run elasticity as c(3)/(1-c(2))=0 and se from the table. See below:

================================================
Normalized Restriction (= 0) Value Std. Err.
================================================
C(3) / (1 - C(2)) 0.910706 0.088253
================================================

But how can I store the two figures for each estimation period? Any alternative way of obtaining the standard error?

Really appreciate your help.

Best,

chang
Attachments
rolling.wf1
(212.48 KiB) Downloaded 234 times

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

Re: store Wald test value and se

Postby EViews Gareth » Thu Feb 02, 2017 2:44 pm

Follow us on Twitter @IHSEViews

shuchang
Posts: 29
Joined: Mon Oct 28, 2013 8:00 pm

Re: store Wald test value and se

Postby shuchang » Fri Feb 03, 2017 2:26 pm

Dear Gareth, many thanks for this. Very useful.

I have a related question. Is there a direct way of storing an explanatory variable's standard errors from a pooled object (using FE estimator)?

I estimate (p_ae being a pooled object)
:
p_ae.ls(cx=f) cpi? c cpi?(-1) ppi_inf?(0 to -3)

Then I can get the coefficient by simply do:
scalar coef1=c(3)

But I don't know how to retrieve the se for c(3).

When I do:
scalar test=@stderrs(3)

The error message says 'no equation in memory'.

If I do

scalar test=p_ae.stderrs(3)

Then the error message says 'stderrs is not a member or procedure for p_ae'.

What can I do? Again convert to a table for storing data?

Best,
chang
Attachments
rolling.wf1
(212.48 KiB) Downloaded 230 times

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

Re: store Wald test value and se

Postby EViews Gareth » Fri Feb 03, 2017 3:07 pm

Follow us on Twitter @IHSEViews

shuchang
Posts: 29
Joined: Mon Oct 28, 2013 8:00 pm

Re: store Wald test value and se

Postby shuchang » Tue Feb 07, 2017 8:42 am

I still don't know how to refer to the standard errors of a variable in a pool regression.

I did this (p_ae is the pooled object):

p_ae.ls(cx=f) cpi? c cpi?(-1)
scalar test=p_ae@stderrs(2)

I get the error 'syntax error'. How can I write the command to get the standard error for cpi(-1)?

chang

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

Re: store Wald test value and se

Postby EViews Gareth » Tue Feb 07, 2017 8:47 am

You're missing a ".".
scalar test=p_ae.@stderrs(2)
Follow us on Twitter @IHSEViews

shuchang
Posts: 29
Joined: Mon Oct 28, 2013 8:00 pm

Re: store Wald test value and se

Postby shuchang » Wed Feb 08, 2017 1:43 am

Got it. Many thanks Gareth. Chang


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 32 guests