Questions on T-stat

For questions regarding programming in the EViews programming language.

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

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Questions on T-stat

Postby diggetybo » Sat Apr 18, 2015 9:44 pm

Hello,

I'm trying to generate a scalar to show a given t stat for my equation: eq01.

This hasn't been working for me... so I have some questions on t stat syntax.

Code: Select all

scalar t_stat = @tdist(.05,eq01.@regobs-eq01.@ncoef)
1. What was I doing wrong here?

2. Is there an easier way to compute the degrees of freedom part, without having to use the whole n-k syntax as I did above?

3. For 5% significance, should it be .025 since it's two tailed?

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

Re: Questions on T-stat

Postby EViews Gareth » Sat Apr 18, 2015 10:15 pm

I'm not quite sure I follow. Are you after an individual coefficient's t-statistic? If so it is just equationname.@tstat(i) where i represents the ith coefficient.

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: Questions on T-stat

Postby diggetybo » Sat Apr 18, 2015 10:53 pm

let me clarify a bit, if I can.

for a large sample size, t.025 (97.5th percentile) is roughly 1.96. However, I want to reference the t stat based on when n is medium or small, or whatever the degrees of freedom given eq01 happen to be.

Why? Because I want to make a parameter prediction where we take t(of eq01 degrees of freedom) * prediction error

so that is the direction I was trying to go with :

Code: Select all

scalar t_stat = @tdist(.05,eq01.@regobs-eq01.@ncoef)
If you're curious, the next step I would take would be multiplying these two in scalar form to show me a predicted interval for my dependent variable:

Code: Select all

scalar Interval_1 = t_stat*pred_error

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: Questions on T-stat

Postby diggetybo » Mon Apr 20, 2015 7:00 am

Just to clear things up, my question is on the syntax for the t-stat, I have a feeling my syntax above doesn't reference eq01 correctly.

The user guides clued me in on the @tdist(x,df) function, but I couldn't find anything in detail.

I hope I have cleared things up, drop a line if you have a feasible solution.

Thanks

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

Re: Questions on T-stat

Postby EViews Gareth » Mon Apr 20, 2015 8:00 am

I don't really know what you're asking. The code you presented will work. Whether it will compute what you want to compute, I have no idea - since I don't know what "tstat" you're after.

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

Re: Questions on T-stat

Postby startz » Mon Apr 20, 2015 8:34 am

It sounds like you want to find the critical value from the t- distribution. If that's what you want, and you want it two-sided, then try

Code: Select all

scalar crit = @qtdist(.975,eq01.@regobs-eq01.@ncoef)

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: Questions on T-stat

Postby diggetybo » Mon Apr 20, 2015 9:08 am

Yea,

Thank you, I guess I needed the @qtdist function after all. I should have mentioned I was computing a confidence interval for a parameter prediction from the beginning, then maybe we'd all be on the same page.

Thanks to you both!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests