to report the p-value in a table

For questions regarding programming in the EViews programming language.

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

nesheus
Posts: 34
Joined: Tue Oct 26, 2010 11:55 am

to report the p-value in a table

Postby nesheus » Tue Oct 26, 2010 1:11 pm

I need to report the p-value of a regression in a table in addition to the following statistics. I cannot find or know how to produce the p-value for each variable in the regression, could you help please?
I am using Eviews 6.
Thanks
best

equation eq2_2.ls dlcopp c ar(1) ar(2) ma(1) ma(2)
scalar aic2_2 = eq2_2.@aic
scalar schwarz2_2 = eq2_2.@schwarz
scalar coef2_2_2 = eq2_2.@COEFS(2)
scalar coef2_2_3 = eq2_2.@COEFS(3)
scalar coef2_2_4 = eq2_2.@COEFS(4)
scalar coef2_2_5 = eq2_2.@COEFS(5)

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: to report the p-value in a table

Postby startz » Tue Oct 26, 2010 1:29 pm

EViews shows the p-value for each coefficient in the rightmost column of the regression output.

nesheus
Posts: 34
Joined: Tue Oct 26, 2010 11:55 am

Re: to report the p-value in a table

Postby nesheus » Tue Oct 26, 2010 1:33 pm

I know. I want to put it in a customized table along with other statistics. So I need to program it.

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

Re: to report the p-value in a table

Postby EViews Gareth » Tue Oct 26, 2010 1:45 pm


nesheus
Posts: 34
Joined: Tue Oct 26, 2010 11:55 am

Re: to report the p-value in a table

Postby nesheus » Tue Oct 26, 2010 2:09 pm

How can I calculate the p-values directly from t-statistics.

I am running an ARIMA model,

equation eq2.ls dlcopp c ar(1) ar(2) ma(1) ma(2)
I have tried the following for the second term ar(1) but it didn't work

scalar pval2= @tdist(eq2.@tstat(2),@obs(ar(1)) or scalar pval2= @tdist(eq2.@tstat(2),@obs)

how can I get the number of observations for each AR or MA series? please help.
thanks

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

Re: to report the p-value in a table

Postby EViews Gareth » Tue Oct 26, 2010 2:14 pm

you probably want to use eq.@regobs (although you might want to adjust by eq.@ncoef

nesheus
Posts: 34
Joined: Tue Oct 26, 2010 11:55 am

Re: to report the p-value in a table

Postby nesheus » Tue Oct 26, 2010 2:21 pm

Should I write it like scalar pval2= @tdist(eq2.@tstat(2),@regobs(2) for the regression eq2.ls dlcopp c ar(1) ar(2) ma(1) ma(2)

Could you be more specific about the use of @regobs or @ncoef?

thanks a lot for your help.

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

Re: to report the p-value in a table

Postby EViews Gareth » Tue Oct 26, 2010 2:48 pm

Code: Select all

scalar pval2 = @tdist(eq2.@tstat(2), eq2.@regobs - eq2.@ncoefs)

nesheus
Posts: 34
Joined: Tue Oct 26, 2010 11:55 am

Re: to report the p-value in a table

Postby nesheus » Wed Oct 27, 2010 6:30 am

thanks a lot, this was very helpful.

Just a quick question. can I write @regobs or @ncoefs after the regression without attaching it to the eq2? would I get the same result?

scalar pval2 = @tdist(eq2.@tstat(2), @regobs - @ncoefs)

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

Re: to report the p-value in a table

Postby EViews Gareth » Wed Oct 27, 2010 8:16 am

Without putting the eq2 in there, @regobs will return the number of observations used in the last regression run. Without knowing the rest of your code, I don't know if the last regression run was eq2 or not.

I think it is always best to be very specific as to which equation you are referring.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests