On Mon, 13 Jun 2016, Sven Schreiber wrote:
Am 13.06.2016 um 17:59 schrieb Sven Schreiber:
> Am 09.06.2016 um 16:26 schrieb Sven Schreiber:
>> there are the options --spearman and --kendall for the 'corr' command.
>> (And in the GUI, Model -> Robust estimation -> Rank correlation).
>>
>> How to get the results of these computations, i.e. what is the
>> function-based variant? The corr() function doesn't do this, according
>> to the doc.
>
> To rephrase the question slightly: Where in the source is the rank
> correlation buried?
Sorry to populate this thread all by myself [and moving to devel]; the rank
correlation seems to reside in lib/src/nonparam.c, ok. There are two
Kendall-related C functions there, one does the actual calculation and the
other one more or less prints the results. Don't know which of these would
need to be hooked up to the hansl corr() function, but I would be interested
to learn how gretl would do this internally.
In general, built-in functions don't print anything, so it would be
the code that calculates tau and its associated z-value that would
have to be hooked up; printing would be skipped.
There are two ways we could give access to Kendall's tau and
Spearman's rho: we could add a third, optional argument to the corr()
function to select a variant other than Pearson, or we could add a
--quiet option to the "corr" command and make it store $test and
$pvalue, so you could use it in function-like mode.
Allin