AndriSignorell / DescTools

Tools for Descriptive Statistics and Exploratory Data Analysis
http://andrisignorell.github.io/DescTools/
81 stars 18 forks source link

Output of DescTools:::.DoCount() #103

Open saschawo opened 1 year ago

saschawo commented 1 year ago

(As asked here: https://stackoverflow.com/questions/75450071/need-help-understanding-the-output-of-desctools-docount)

As the documentation of DescTools:::ConDisPairs() says, the function DescTools:::.DoCount() returns "only concorant and discordant pairs". However, there are 4 non-NA list elements that are returned by the function named C, D, T, and N. I understand that C and D stand for "Concordant" and "Discordant". I guess that T stands for "Ties". I do not know what N stands for.

Could you please clarify this?

Thanks also for the great package. .DoCount() is EXACTLY what I need, and it's blazingly fast even for huge datasets!

GegznaV commented 4 months ago

@saschawo, you can look into the result of DescTools:::.DoCount (no parentheses). Did you study that output?

On the other hand, non-exported functions are not safe to use. So do you really need that function?

saschawo commented 4 months ago

Thank you for your answer. Indeed, I have looked at the output of DescTools:::.DoCount() and that is the issue: C, D, T, and N are given, and I do not know what they mean exactly (or, more specifically, what the difference between T and N is). I would really love to use .DoCount() because it's extremely fast and (unlike ConDisPairs()) gives the raw numbers of pairs.

As it says in the documentation of ConDisPairs(): "An O(n log(n)) implementation is available as (so far) undocumented function DescTools:::.DoCount(x, y, wts) returning only concorant and discordant pairs (not including standard errors to be used for calculating confidence intervals)."