2
$\begingroup$

I see this question as more a matter of opinion and specific to the quantity or interest and what information you seek, however I thought some might have a pragmatic rule.

Essentially, I am writing a personal R script for generating descriptive tables to streamline my reports (like createTableOne, Stargazer etc.).

I wanted to write in a general rule for when the table should report mean (SD) or median (25th, 75th percentile) for numeric variables. Right now I have to specify for the function what I want, which is okay but I wanted to see if I could get fancier with it.

I was thinking about maybe some rule like so: if mean/median > 1.5 or <0.5 than report median (IQR).

$\endgroup$

1 Answer 1

1
$\begingroup$

A general rule of thumb for reporting mean or median as the defining measure of central tendency is a function of skewness. In a normally distributed distribution (with skew more or less between -1 and 1), the mean is the best measure of central tendency. With positively and negatively skewed distributions, however, median might be a better measure of central tendency. For the purposes of writing a function() (or a script, as you call it) to make your workflow more efficient, this rule of thumb might work for you. Altogether though, there is no overarching rule in this matter. Finally, I would argue for always reporting the mean over the median as it is the best measure of all participants' scores.

$\endgroup$
2
  • $\begingroup$ Appreciate the point, I will consider abs(skewness(x))>=1 as a rule. I do think mean is generally better, but median/mode is often done conventionally for certain variables in my field (i.e. length of hospital stay). $\endgroup$
    – KevinM
    Mar 9, 2017 at 19:35
  • 1
    $\begingroup$ @KevinM, it depends on the type of variable in question. LoS is time to event data. It cannot be normally distributed. It is typically very skewed & often rather irregular (eg, not fitting any of the 'named' survival time distributions well). It is typical (& appropriate) to use medians & quartiles for such data. This example illustrates that "there is no [nor could be any] overarching rule in this matter", as Jay states. $\endgroup$ May 21, 2018 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.