Page 1 of 1
Questions on T-stat
Posted: Sat Apr 18, 2015 9:44 pm
by diggetybo
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?
Re: Questions on T-stat
Posted: Sat Apr 18, 2015 10:15 pm
by EViews Gareth
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.
Re: Questions on T-stat
Posted: Sat Apr 18, 2015 10:53 pm
by diggetybo
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
Re: Questions on T-stat
Posted: Mon Apr 20, 2015 7:00 am
by diggetybo
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
Re: Questions on T-stat
Posted: Mon Apr 20, 2015 8:00 am
by EViews Gareth
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.
Re: Questions on T-stat
Posted: Mon Apr 20, 2015 8:34 am
by startz
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)
Re: Questions on T-stat
Posted: Mon Apr 20, 2015 9:08 am
by diggetybo
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!