Am 20.07.2022 um 19:20 schrieb Filipe R. Costa:
Hi all,

Is it possible to capture the results from Wald tests linear restrictions similarly to what we can do with $model into a bundle?

Let me use an example file from Gretl:

<hansl>

open AWM18.gdt
# model 1
ols YER const PCR GCR
bundle bundle1 = $model

# Apply the linear restriction
restrict
b[2]-b[3]=0
end restrict
</hansl>

I'm interested in the test statistic, p-value and eventually degrees of freedom. Any very simple way to retrieve them, without computing manually from bundle1 results?

Yes, for that you have the $test, $pvalue, and $df accessors, where the latter refers to the underlying model, so in terms of the Wald test it will be the denominator d.o.f. of the F test stat.

As for the numerator d.o.f., I'm afraid you would have to figure these out by yourself, but since you specified the hypothesis, that shouldn't be a problem. (In this case, it's a single restriction, so 1.)

So overall, the following should yield TRUE/1 in your case of a single restriction:

eval pvalue("F", 1, $df, $test) == $pvalue

cheers

sven