Fetch the P-Values
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Fetch the P-Values
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
Thanks
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Fetch the P-Values
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
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.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Fetch the P-Values
Oh well...how do i calculate the Prob in terms of the t-statistics?
Thanks for your time.
Thanks for your time.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Fetch the P-Values
For a standard least squares:
where !tstat is the corresponding t-statistic, and !df is the degrees of freedom (usually !obs-!ncoefs)
Code: Select all
!pval = @tdist(!tstat, !df)
Re: Fetch the P-Values
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?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Fetch the P-Values
The EViews Object Reference is a reference for all EViews objects.
Re: Fetch the P-Values
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 :(
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 :(
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Fetch the P-Values
Pretty certain the Object Reference says it is .@regobs and .@ncoef
Re: Fetch the P-Values
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.
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.
- Attachments
-
- regressions best lags 2.prg
- (848 Bytes) Downloaded 447 times
Re: Fetch the P-Values
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
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
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 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 -
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Fetch the P-Values
You have deleted the equation.
Who is online
Users browsing this forum: No registered users and 2 guests
