The capture log and user guide have both been invaluable in my study on two stage LS. I'm hitting a roadblock, when I try to retrieve the p value from the chi sq distribution. The following chi sq syntax I found on pg 161 of eviews 8 object reference, but perhaps a different syntax is needed here? That's question #1.
Have a look at my simple program (almost complete):
Code: Select all
equation 2SLS_eq.tsls y1 c y2 x1 x2 @ x1 x2 iv1 iv2
series error_hat = resid
equation overspec_eq.ls error_hat c x1 x2 iv1 iv2
scalar chi_val = overspec_eq.@regobs*overspec_eq.@r2
scalar chi_pval = chi_val.@chisqprob(1)
Question #2: In the program above, I put a 1 after @chisqprob(1), assuming that's what goes inside the parentheses -- the order, but I got an error, so I'm probably wrong. Nevertheless, once that's straightened out, I would like to improve the code in this procedure for the general case. Instead of a 1 or whatever goes there, I wanted to use code to reference the count of instruments outside the equation minus the endogenous variables. This way, whether I have 2, 3, or 4 IV's or 3-4 or endogenous variables or whatever combination of the two may be, my program will be robust in computing the correct chisq pval.
Thanks for reading
