Page 1 of 1

Fetch the P-Values

Posted: Fri Mar 25, 2011 5:14 pm
by marcounam
How do i fetch the P-Values of the variables of a regression example eq1.@coefs(1) gives me the alpha of aregression, so the question is how do i do the same thing for the P-Values in this case im running a regression with 6 independent variables so i need to fetch all 6 P-Values.

Thanks

Re: Fetch the P-Values

Posted: Fri Mar 25, 2011 5:59 pm
by EViews Gareth
There's nothing built in that will grab it for you, you'll have to calculate it from the t/z-statistic.

Re: Fetch the P-Values

Posted: Mon Mar 28, 2011 12:08 pm
by marcounam
Really? but it is an output of the regression, so eviews alredy calculates it. Im talking about the numbers under the heading Prob in the output format of a regression.

Fetch the P-Values

Posted: Mon Mar 28, 2011 12:33 pm
by EViews Gareth
Yep

Re: Fetch the P-Values

Posted: Mon Mar 28, 2011 2:31 pm
by marcounam
Oh well...how do i calculate the Prob in terms of the t-statistics?
Thanks for your time.

Re: Fetch the P-Values

Posted: Mon Mar 28, 2011 2:35 pm
by EViews Gareth
For a standard least squares:

Code: Select all

!pval = @tdist(!tstat, !df)
where !tstat is the corresponding t-statistic, and !df is the degrees of freedom (usually !obs-!ncoefs)

Re: Fetch the P-Values

Posted: Mon Mar 28, 2011 4:55 pm
by marcounam
Ok thanks! What i would really like to have is a list of the things i can fetch of a given regression and how can i fetch it, for example in my first post i showed how to fetch the coefficients of a given regression. The problem i have now is that i dont know how to obtain the number of observations used in the regression, nor if it is even possible to obtain. Also i dont know if the constant c is included in the formula for the p-value in terms of the t-statistic. Is this information in eviews help somewhere?

Re: Fetch the P-Values

Posted: Mon Mar 28, 2011 5:01 pm
by EViews Gareth
The EViews Object Reference is a reference for all EViews objects.

Re: Fetch the P-Values

Posted: Mon Mar 28, 2011 5:21 pm
by marcounam
Im sorry to keep bothering you :
So i checked the object reference and the prob should be equal to :

!pval1 = @tdist( {%i}{!a}{!b}{!c}.tstats(2) , {%i}{!a}{!b}{!c}.regobs-{%i}{!a}{!b}{!c}.ncoef )

But i get the following error:
!pval1 is not defined or an illegal command in !pval=@tdist(banamexA000.TSTATS(2),banamexA000.REGOBS-banamexA000.NCOEF).

once again i dont see the problem :(

Re: Fetch the P-Values

Posted: Mon Mar 28, 2011 6:42 pm
by EViews Gareth
Pretty certain the Object Reference says it is .@regobs and .@ncoef

Re: Fetch the P-Values

Posted: Mon Mar 28, 2011 6:57 pm
by marcounam
In the code i attached, i run it and get the following error:

BANAMEX0412 is not defined in "!PVAL1=@TDIST(BANAMEXA0412.@TSTATS(2) , BANAMEXA0412.@REGOBS-BANAMEXA0412.@REGOBS-BANAMEXA0412.@NCOEF)".

Supposedly im getting the t-statistic of the second dependent variable with BANAMEXA0412.@TSTATS(2) , the number of observations with BANAMEXA0412.@REGOBS and the quantity of coefficients with BANAMEXA0412.@NCOEF which are the inputs i need to calculate the p-value of the second dependent variable. If i put 2 constant numbers as inputs to the @tdist function the program runs completely. Please could someone help me?

Thanks in advance.

Re: Fetch the P-Values

Posted: Mon Mar 28, 2011 7:03 pm
by marcounam
Dear Eviews Gareth :

Yes i detected that error, and now i get the error i explained in my most recent post. I aprreciate your time infinitely and i am trying to fix the problem as we speak, but sometimes i see what i want to see and not what is written; maybe you could detect the problem with your eyes.

Again Many Thanks

Re: Fetch the P-Values

Posted: Tue Mar 29, 2011 9:45 am
by marcounam

Code: Select all

if @tdist( {%i}{!a}{!b}{!c}.@tstats(2) , {%i}{!a}{!b}{!c}.@regobs - {%i}{!a}{!b}{!c}.@ncoef )>0.05 then delete {%i}{!a}{!b}{!c}
The problem is on the line i wrote above. I have checked that line a million times i do not see the problem. What is most annoying is that the program runs for the first 8 regressions and then in banamexa0412 it says it is not defined in the line of code i wrote above.

The whole code is the following :

Code: Select all

smpl 2005 2010 for %i banamexa bbva_bancomera santandera banortea hsbca inbursaa scotiabanka inga bajioa interaccionesa ixea aztecaa for !a=0 to 12 step 4 for !b=0 to 12 step 4 for !c=0 to 12 step 4 equation {%i}{!a}{!b}{!c}.ls @qnorm({%i}) c totcred_gdp(-3*!a) vimex(-3*!b) cycle_bienes(-3*!c) if {%i}{!a}{!b}{!c}.@coefs(3)<0 then delete {%i}{!a}{!b}{!c} endif if @tdist( {%i}{!a}{!b}{!c}.@tstats(2) , {%i}{!a}{!b}{!c}.@regobs - {%i}{!a}{!b}{!c}.@ncoef )>0.05 then delete {%i}{!a}{!b}{!c} endif next next next next smpl @all
Anyone see the problem?

Re: Fetch the P-Values

Posted: Tue Mar 29, 2011 9:55 am
by EViews Gareth
You have deleted the equation.