Am 02.03.2023 um 11:50 schrieb Alison Loddick:
I’m sure this is an easy question for econometricians rather than me
as a statistician, but when using non-parametric correlation GRETL
gives significance values and only one correlation at a time, but when
using parametric correlation, we get a matrix but no significance values.
Hi, let's first make sure we're talking about the same things here: When
you say "non-parametric correlation", I guess you're using the GUI and
went to Tools/Nonparametric Tests/Correlation, where you have the choice
between Kendall's tau and Spearman's rho (and can only enter two
variables). And I suppose that "parametric correlation" means going to
View/Correlation matrix, where you can choose an arbitrary number of
variables. Please correct me if that's not what you're doing.
Here are some remarks about that:
- I can confirm the limitation of two variables for the Kendall /
Spearman tests. If scripting is an option, then it's fairly easy to
write a loop like this:
<hansl>
open banks91.gdt # example data included in gretl
include extra.gfn # needed for convenience function 'combinations'
list allwanted = P1..P3
matrix indices = allwanted
matrix pairs = combinations(indices, 2)
loop i = 1..rows(pairs)
corr pairs[i, 1] pairs[i, 2] --kendall # or --spearman
endloop
</hansl>
Admittedly, output in the form of a matrix would be a little more work.
Perhaps at some point the 'corr' command could be extended to cover this.
- About the parametric thing, I'm noting that you get the pairwise test
for n=2, and a (significance) test for non-correlation also for n>2, but
the latter appears to be a joint test with respect to all off-diagonal
correlations. If I understand correctly, you want a battery of pairwise
tests. Of course, you could simply reuse the loop above without the
--kendall option. But given that we even have a heatmap button in the
correlation output, I agree that it would make sense to compute the
pairwise tests automatically.
I also ask this question as when teaching using GRETL, a matrix for
non-parametric correlation would be a preferred output that students
can put in a document rather than creating one themselves from
individual answers.
Thanks for your feedback
cheers
sven