{"id":3468,"date":"2026-03-01T20:32:03","date_gmt":"2026-03-01T19:32:03","guid":{"rendered":"https:\/\/www.gironi.it\/blog\/?p=3468"},"modified":"2026-10-06T08:35:32","modified_gmt":"2026-10-06T07:35:32","slug":"descriptive-statistics-measures-of-variability-or-dispersion","status":"publish","type":"post","link":"https:\/\/www.gironi.it\/blog\/en\/descriptive-statistics-measures-of-variability-or-dispersion\/","title":{"rendered":"Standard Deviation and CV: when the mean alone deceives you (SEO case studies)"},"content":{"rendered":"<p>Two sites, two charts of daily sessions. The first swings by almost 400 sessions a day, the second by just 52: one would be tempted to call the first far less stable.<br>The opposite is true, and to notice it the mean is not enough: we need to know how far the data stray from it.<\/p>\n\n<p>That is the job of <strong>measures of dispersion<\/strong> (or of variability): describing how much the observations spread around a central value, the <a href=\"https:\/\/www.gironi.it\/blog\/en\/descriptive-statistics-measures-of-position-and-central-tendency\/#the-arithmetic-mean\">mean<\/a> or the <a href=\"https:\/\/www.gironi.it\/blog\/en\/descriptive-statistics-measures-of-position-and-central-tendency\/#the-median\">median<\/a>. Two datasets with the same centre can tell opposite stories, and these measures are what reveal it.<\/p>\n\n<p>The techniques for measuring the variability of datasets are numerous. Among them, the most widely known (and most commonly used) are:<\/p>\n\n<ul>\n<li>the <a href=\"#range\">range<\/a><\/li>\n<li>the <a href=\"#mean-deviation\">mean deviation<\/a> and the <a href=\"#variance\">variance<\/a><\/li>\n<li>the <a href=\"#standard-deviation\">standard deviation<\/a><\/li>\n<li>the <a href=\"#iqr\">interquartile range<\/a><\/li>\n<li>the <a href=\"#cv\">coefficient of variation<\/a><\/li>\n<\/ul>\n\n<p>We will also visualise the concepts of central tendency and dispersion by revisiting <a href=\"#skewness\">skewness<\/a> and introducing the concept of <a href=\"#kurtosis\">kurtosis<\/a>.<\/p>\n\n<!--more-->\n\n<p><strong>In short:<\/strong> <strong>measures of dispersion<\/strong> tell us how far the data stray from the centre. The <strong>range<\/strong> (maximum minus minimum) is the quickest but depends on two values only; the <strong>variance<\/strong> is the mean of the squared deviations from the mean, the <strong>standard deviation<\/strong> its square root, in the same unit as the data; the <strong>interquartile range<\/strong> (Q3 \u2212 Q1) is robust to outliers; the <strong>coefficient of variation<\/strong> (standard deviation divided by the mean) is a pure number that lets us compare different scales.<\/p>\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Measure<\/th><th>What it is<\/th><th>Strength<\/th><th>Limit<\/th><th>In R<\/th><\/tr><\/thead><tbody><tr><td><strong>Range<\/strong><\/td><td>maximum minus minimum<\/td><td>immediate<\/td><td>depends on two values only<\/td><td><code>diff(range(x))<\/code><\/td><\/tr><tr><td><strong>Variance<\/strong><\/td><td>mean of the squared deviations from the mean<\/td><td>the basis of almost all inference<\/td><td>squared units, hard to read<\/td><td><code>var(x)<\/code><\/td><\/tr><tr><td><strong>Standard deviation<\/strong><\/td><td>square root of the variance<\/td><td>same unit as the data<\/td><td>inflated by outliers<\/td><td><code>sd(x)<\/code><\/td><\/tr><tr><td><strong>Interquartile range<\/strong><\/td><td>Q3 \u2212 Q1, the width of the middle half<\/td><td>robust to outliers<\/td><td>ignores the tails<\/td><td><code>IQR(x)<\/code><\/td><\/tr><tr><td><strong>Coefficient of variation<\/strong><\/td><td>standard deviation divided by the mean<\/td><td>compares different scales<\/td><td>meaningless with means near zero<\/td><td><code>sd(x) \/ mean(x)<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n<hr \/>\n\n<div style=\"border: 1px solid #ccc;padding: 1.2em 1.5em;margin: 1.5em 0;border-radius: 6px\">\n<h3 style=\"margin-top: 0\">What We&#8217;ll Cover<\/h3>\n<ul>\n<li><a href=\"#range\">The Range<\/a><\/li>\n<li><a href=\"#mean-deviation\">The Mean Deviation<\/a><\/li>\n<li><a href=\"#variance\">Variance<\/a><\/li>\n<li><a href=\"#standard-deviation\">The Standard Deviation<\/a><\/li>\n<li><a href=\"#iqr\">The Interquartile Range (IQR)<\/a><\/li>\n<li><a href=\"#cv\">The Coefficient of Variation<\/a><\/li>\n<li><a href=\"#skewness\">The Shape of a Distribution<\/a><\/li>\n<li><a href=\"#kurtosis\">Kurtosis<\/a><\/li>\n<li><a href=\"#practical-seo-case\">A Practical SEO Case: Comparing Two Sites with the CV<\/a><\/li>\n<li><a href=\"#try-it-yourself\">Try It Yourself<\/a><\/li>\n<li><a href=\"#faq\">Frequently asked questions<\/a><\/li>\n<li><a href=\"#further-reading\">Further Reading<\/a><\/li>\n<\/ul>\n<\/div>\n\n<hr \/>\n\n<h2 id=\"range\">The Range<\/h2>\n\n<p>The range is the <strong>difference between the maximum and the minimum value<\/strong> of ungrouped data in a frequency distribution.<\/p>\n\n<p>It is a very quick calculation, which in R can be computed as follows:<\/p>\n\n<pre><code class=\"language-r\">max(var) - min(var)<\/code><\/pre>\n\n<p>The maximum and minimum can also be displayed with:<\/p>\n\n<pre><code class=\"language-r\">range(var)<\/code><\/pre>\n\n<p>and they appear as the first and last terms in:<\/p>\n\n<pre><code class=\"language-r\">fivenum(var)<\/code><\/pre>\n\n<p>For grouped data, the range is defined as the difference between the upper boundary of the highest class and the lower boundary of the lowest class.<\/p>\n\n<p>A <strong>trimmed range<\/strong> is a range from which a certain percentage of extreme values has been removed from both ends of the distribution (for instance, the <em>middle 80 per cent<\/em>).<\/p>\n\n<hr \/>\n\n<h2 id=\"mean-deviation\">The Mean Deviation<\/h2>\n\n<p>The mean deviation is a measure of variability based on the difference between each data point and the mean. If we calculated the average by summing the positive and negative differences between each value and the arithmetic mean, <strong>the result would always be zero<\/strong>. For this reason, we <strong>sum the absolute values of the differences<\/strong>:<\/p>\n\n\\(\nSM = \\frac{\\Sigma|X &#8211; \\mu|}{N} \\\\\n\\)\n\n<p>Those &#8220;absolute values&#8221; lend themselves poorly to algebra (they cannot easily be expanded or differentiated), which is why the mean deviation is rarely used. There is another way to eliminate negative values, and so we introduce the important concept of&#8230;<\/p>\n\n<h2 id=\"variance\">The Variance<\/h2>\n\n<p>Variance is analogous to the mean deviation, since it is based on the <strong>differences between each data point and the mean<\/strong>, but these differences are <strong>squared before being summed<\/strong>. Variance is denoted by the lowercase sigma squared symbol, and the formula is:<\/p>\n\n\\(\n\\sigma^{2}=\\frac{\\Sigma(X &#8211; \\mu)^{2}}{N} \\\\ \\\\\n\\)\n\n<p>R has the <code>var()<\/code> function for computing variance, but it uses <em>(n-1)<\/em> in the denominator. To obtain the variance with <em>N<\/em> in the denominator, we can define a custom function:<\/p>\n\n<pre><code class=\"language-r\">pop_var <- function(x) { var(x) * (1 - 1\/length(x)) }<\/code><\/pre>\n\n<p>In general, <strong>interpreting the value of a variance is difficult<\/strong> because <strong>the units it is expressed in are not the same as those of the original observations<\/strong>.<\/p>\n\n<p>For this reason, the <em>standard deviation<\/em> was introduced.<\/p>\n\n<h2 id=\"standard-deviation\">The Standard Deviation: The Most Widely Used Measure of Variability<\/h2>\n\n<p>The standard deviation is simply the <strong>square root of the variance<\/strong>:<\/p>\n\n\\(\n\\sigma = \\sqrt{\\frac{\\Sigma(X - \\mu)^{2}}{N}} \\\\ \\\\\n\\)\n\n<p>The standard deviation is of fundamental utility in statistics, particularly (as we shall see) in conjunction with the <a href=\"https:\/\/www.gironi.it\/blog\/en\/the-normal-distribution\/\">normal distribution<\/a>.<\/p>\n\n<p>For grouped data, we assume that the midpoint of each class represents all the measurements within that class. The variance formula then becomes:<\/p>\n\n\\(\n\\sigma^{2}=\\frac{\\Sigma f(X - \\mu)^{2}}{N} \\\\ \\\\\n\\)\n\n<p>and the standard deviation:<\/p>\n\n\\(\n\\sigma = \\sqrt{\\frac{\\Sigma f(X - \\mu)^{2}}{N}} \\\\ \\\\\n\\)\n\n<p>In R, the function for computing the standard deviation is <code>sd()<\/code>. However, R uses <em>(n-1)<\/em> in the denominator. So, if we want the population standard deviation (with <em>n<\/em> in the denominator), we can define a dedicated function:<\/p>\n\n<pre><code class=\"language-r\">pop_sd <- function(x) { sqrt(sum((x - mean(x))^2) \/ length(x)) }<\/code><\/pre>\n\n<h2 id=\"iqr\">The Interquartile Range (IQR)<\/h2>\n\n<p>All the measures seen so far revolve around the mean, and inherit its weakness: a single outlier is enough to inflate them. The <strong>interquartile range<\/strong> (IQR) takes another road: it is the distance between the third and the first quartile, that is the width of the middle half of the data.<\/p>\n\n\\(\nIQR = Q_{3} - Q_{1}\n\\)\n\n<p>Precisely because it leaves out the lowest and the highest quarter of the data, <strong>the interquartile range is not dragged by extreme values<\/strong>: it is the natural measure of dispersion to pair with the <a href=\"https:\/\/www.gironi.it\/blog\/en\/descriptive-statistics-measures-of-position-and-central-tendency\/#the-median\">median<\/a>, and it is the height of the box in the <a href=\"https:\/\/www.gironi.it\/blog\/en\/descriptive-statistics-measures-of-position-and-central-tendency\/\">boxplot<\/a>. Let's compute it in R on the same data we will use for the coefficient of variation:<\/p>\n\n<pre><code class=\"language-r\">data &lt;- c(24,17,21,23,15,30,24,21,24,19,25,28,22,20,14,19,26,29,23,25,24,18,27,21)\nquantile(data, c(0.25, 0.75))\n#   25%   75%\n# 19.75 25.00\nIQR(data)\n# [1] 5.25<\/code><\/pre>\n\n<p>The middle half of the data therefore lies in an interval 5.25 wide.<br>(Note: R computes quartiles by interpolating between values; other software, or the rules for hand calculation, can give slightly different results. Nothing to worry about.) The interquartile range is also the yardstick of the most widely used rule for flagging <a href=\"https:\/\/www.gironi.it\/blog\/en\/anomaly-detection-how-to-identify-outliers-in-your-data\/\">outliers<\/a>: points lying more than 1.5 times the IQR beyond the first or third quartile are suspect.<\/p>\n\n<h2 id=\"cv\">The Coefficient of Variation (CV)<\/h2>\n\n<p>The coefficient of variation indicates the relative magnitude of the standard deviation with respect to the distribution mean. It is extremely useful for comparing phenomena expressed in different units of measurement, since <strong>the CV is a \"pure\" number, independent of the unit of measurement<\/strong>:<\/p>\n\n\\(\nCV = \\frac{\\sigma}{\\mu} \\\\\n\\)\n\n<p>As is often the case in R, there is a ready-made function: we can use <code>cv()<\/code>, defined in an external library, <a href=\"https:\/\/cran.r-project.org\/web\/packages\/labstatR\/index.html\" target=\"_blank\" rel=\"noreferrer noopener\">labstatR<\/a>. Its usage is straightforward:<\/p>\n\n<pre><code class=\"language-r\">library(labstatR)\ndata <- c(24, 17, 21, 23, 15, 30, 24, 21, 24, 19,\n          25, 28, 22, 20, 14, 19, 26, 29, 23, 25,\n          24, 18, 27, 21)\ncv(data)\n# [1] 0.1817708<\/code><\/pre>\n\n<p>We can also calculate the value quite simply without resorting to external libraries:<\/p>\n\n<pre><code class=\"language-r\">data <- c(24, 17, 21, 23, 15, 30, 24, 21, 24, 19,\n          25, 28, 22, 20, 14, 19, 26, 29, 23, 25,\n          24, 18, 27, 21)\npop_sd <- function(x) { sqrt(sum((x - mean(x))^2) \/ length(x)) }\ncv_data <- pop_sd(data) \/ mean(data)\ncv_data\n# [1] 0.1817708<\/code><\/pre>\n\n<h2 id=\"skewness\">The Shape of a Distribution<\/h2>\n\n<p>Frequency distributions can take on the most varied shapes. Among all of them, the one by far most important in statistics is the <strong>normal distribution<\/strong>, also known as the <strong>bell curve<\/strong> or <strong>Gaussian distribution<\/strong>.<\/p>\n\n<p>In a <strong><a href=\"https:\/\/www.gironi.it\/blog\/en\/the-normal-distribution\/\">normal<\/a><\/strong> distribution, data are arranged <strong>symmetrically around the mean<\/strong>. A first clue to the shape of the distribution comes from <strong>comparing the mean with the median<\/strong>: if they are <strong>close, the distribution is probably symmetric<\/strong> (a clue, not a proof). If the mean is greater than the median, we have <strong>positive skewness<\/strong> (with a longer \"tail\" on the right); if the mean is less than the median, the skewness is <strong>negative<\/strong> (with the longer \"tail\" on the left).<\/p>\n\n<p>The best-known formula for calculating the skewness of a distribution is <strong>Pearson's coefficient of skewness<\/strong>:<\/p>\n\n\\(\nSkewness = \\frac{3(\\mu - med)}{\\sigma} \\\\ \\\\\n\\)\n\n<p>A perfectly symmetric distribution has a skewness value of 0. A right-skewed (positive) distribution has a positive value, while a left-skewed distribution has a negative value.<\/p>\n\n<p>Skewness values typically fall between -3 and 3, and the fact that the standard deviation appears in the denominator makes the <strong>value independent of the unit of measurement<\/strong>.<\/p>\n\n<p>How do we calculate the skewness index in R? The simplest way is to use a library that provides the functions we need \"ready to go\":<\/p>\n\n<pre><code class=\"language-r\">library(moments)\ndata <- c(24, 17, 21, 23, 15, 30, 24, 21, 24, 19,\n          25, 28, 22, 20, 14, 19, 26, 29, 23, 25,\n          24, 18, 27, 21)\nskewness(data)\n# [1] -0.1918578<\/code><\/pre>\n\n<p>The <code>moments<\/code> library serves us well. Let us see, however, how to calculate the index without relying on a library. It is very simple. The first step is to remember that <strong>R uses <em>n-1<\/em> in the denominator of the variance<\/strong>. We are reasoning about a population, however, with <em>n<\/em> in the denominator. So, let us define a function that gives us the value we need:<\/p>\n\n<pre><code class=\"language-r\">pop_var <- function(x) { var(x) * (1 - 1\/length(x)) }<\/code><\/pre>\n\n<p>At this point we can calculate the skewness index:<\/p>\n\n<pre><code class=\"language-r\">data <- c(24, 17, 21, 23, 15, 30, 24, 21, 24, 19,\n          25, 28, 22, 20, 14, 19, 26, 29, 23, 25,\n          24, 18, 27, 21)\npop_var <- function(x) { var(x) * (1 - 1\/length(x)) }\nz <- (data - mean(data)) \/ sqrt(pop_var(data))\nskew <- mean(z^3)\nskew\n# [1] -0.1918578<\/code><\/pre>\n\n<h2 id=\"kurtosis\">Kurtosis<\/h2>\n\n<p><strong>Kurtosis<\/strong> compares the shape of a distribution with that of the normal: how peaked it is at the centre and, above all, <strong>how \u00abheavy\u00bb its tails are<\/strong>, that is how often values far from the mean turn up.<\/p>\n\n<p>We have three cases:<\/p>\n\n<ol>\n<li>a <strong>tall<\/strong> curve, called <em><strong>leptokurtic<\/strong><\/em>, which is highly concentrated around its mean<\/li>\n<li>a <strong>normal<\/strong> curve, called <em><strong>mesokurtic<\/strong><\/em><\/li>\n<li>a <strong>low and flat<\/strong> curve, called <em><strong>platykurtic<\/strong><\/em>, with little concentration around its mean<\/li>\n<\/ol>\n\n<figure><img decoding=\"async\" src=\"https:\/\/www.gironi.it\/blog\/wp-content\/uploads\/2018\/10\/curtosi.jpg\" alt=\"Measures of variability: leptokurtic, mesokurtic, and platykurtic curves\" \/><\/figure>\n\n<p>Kurtosis can be measured by dividing the fourth moment by the standard deviation raised to the fourth power. Sounds difficult? It is easier done than said. Here is the formula:<\/p>\n\n\\(\nKurtosis = \\frac{\\Sigma f(X -\\mu)^{4}}{N \\sigma^{4}} \\\\ \\\\\n\\)\n\n<p>The kurtosis of a mesokurtic curve has a value of 3. Naturally, a kurtosis coefficient less than 3 indicates a platykurtic curve, while a value greater than 3 indicates a leptokurtic curve.<br><br>Note: many tools, Excel's KURT function included, return the <strong>excess kurtosis<\/strong>, that is the value minus 3 (with a small correction for samples): there the normal is 0. The 2.48 we are about to obtain corresponds to an excess of about \u22120.52: a slightly platykurtic curve.<\/p>\n\n<p>As with the skewness index, the <code>moments<\/code> library provides a convenient ready-made function:<\/p>\n\n<pre><code class=\"language-r\">library(moments)\ndata <- c(24, 17, 21, 23, 15, 30, 24, 21, 24, 19,\n          25, 28, 22, 20, 14, 19, 26, 29, 23, 25,\n          24, 18, 27, 21)\nkurtosis(data)\n# [1] 2.480035<\/code><\/pre>\n\n<p>But we are not averse to computing it ourselves:<\/p>\n\n<pre><code class=\"language-r\">data <- c(24, 17, 21, 23, 15, 30, 24, 21, 24, 19,\n          25, 28, 22, 20, 14, 19, 26, 29, 23, 25,\n          24, 18, 27, 21)\npop_var <- function(x) { var(x) * (1 - 1\/length(x)) }\nz <- (data - mean(data)) \/ sqrt(pop_var(data))\nkurt <- mean(z^4)\nkurt\n# [1] 2.480035<\/code><\/pre>\n\n<p>We have seen that measures of central tendency alone are not enough: two datasets can have the same mean yet behave in profoundly different ways. Variability tells us <em>how much<\/em> the data fluctuate, and the shape of the distribution tells us <em>how<\/em> they are arranged. In the next article, we will take the first steps into the world of probability\u2014the essential bridge between descriptive statistics and the inferential tools that let us draw conclusions from data.<\/p>\n\n<h2 id=\"practical-seo-case\">A Practical SEO Case: the Coefficient of Variation to Compare Two Sites<\/h2>\n\n<p>The standard deviation, on its own, can mislead when we compare quantities of different scale. Take two sites: a big one, around 5,000 sessions a day, and a small one, around 300. Let's measure the daily variability of each in R.<\/p>\n\n<pre><code>big   &lt;- c(4800, 5300, 4600, 5500, 5100, 4400, 5600, 4900, 5200, 4700)\nsmall &lt;- c(260, 340, 220, 380, 300, 240, 360, 280, 320, 300)\n\nsd(big)                 # 395.7\nsd(small)               # 51.6\nsd(big) \/ mean(big)         # CV = 0.079  (7.9%)\nsd(small) \/ mean(small)     # CV = 0.172  (17.2%)<\/code><\/pre>\n\n<p>In absolute terms the big site swings by almost 400 sessions a day, the small one by just 52: one would be tempted to call the big site far more &ldquo;jumpy&rdquo;. But that is an illusion of scale. The <strong>coefficient of variation<\/strong> &mdash; the standard deviation divided by the mean, a pure number read as a percentage &mdash; tells the opposite story: <strong>7.9%<\/strong> for the big site, <strong>17.2%<\/strong> for the small one. Relative to its own size, the small site is more than twice as unstable. This is exactly what the CV is for: it makes comparable variabilities that, in raw units, would not be.<\/p>\n\n\n<div class=\"wp-block-group has-background\" style=\"background-color:#f5f7f9;margin-top:2.5rem;margin-bottom:2.5rem;padding-top:1.5rem;padding-right:1.5rem;padding-bottom:1rem;padding-left:1.5rem\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-container-core-group-is-layout-eed7543b wp-block-group-is-layout-constrained\">\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1260\" height=\"645\" src=\"https:\/\/www.gironi.it\/blog\/wp-content\/uploads\/2026\/07\/dispersione-cv-due-siti-en.png\" alt=\"Same data, two readings: in raw sessions the small site looks flat, but as a percentage of the mean it swings twice as much \u2014 the illusion of scale that the coefficient of variation dispels.\" class=\"wp-image-4315\" srcset=\"https:\/\/www.gironi.it\/blog\/wp-content\/uploads\/2026\/07\/dispersione-cv-due-siti-en.png 1260w, https:\/\/www.gironi.it\/blog\/wp-content\/uploads\/2026\/07\/dispersione-cv-due-siti-en-300x154.png 300w, https:\/\/www.gironi.it\/blog\/wp-content\/uploads\/2026\/07\/dispersione-cv-due-siti-en-1024x524.png 1024w, https:\/\/www.gironi.it\/blog\/wp-content\/uploads\/2026\/07\/dispersione-cv-due-siti-en-1200x614.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption class=\"wp-element-caption\">Same data, two readings: in raw sessions the small site looks flat, but as a percentage of the mean it swings twice as much \u2014 the illusion of scale that the coefficient of variation dispels.<\/figcaption><\/figure>\n\n<\/div><\/div>\n\n\n<p>The operational rule is clear: <strong>when we compare the variability of metrics on different scales<\/strong> &mdash; two sites, two channels, two periods with very different volumes &mdash; the coefficient of variation is the tool to use, not the bare standard deviation. The latter remains irreplaceable when the scale is the same.<\/p>\n\n<h2 id=\"try-it-yourself\">Try It Yourself<\/h2>\n\n<p>Let's try a similar case. We have a week of daily clicks for two channels: organic, robust, and a niche referral. Which of the two is steadier, net of the difference in volume?<\/p>\n\n<pre>organic:   1200  1350  1100  1280  1420  1180  1320\nreferral:    80   140    60   170    95   130   110<\/pre>\n\n<p>The task: for each channel, compute the CV with <code>sd(x) \/ mean(x)<\/code>.<\/p>\n\n<p>To check the numbers: organic has a CV of <strong>8.7%<\/strong>, the referral one of <strong>33.5%<\/strong>. Although it brings ten times fewer clicks, the referral is nearly four times more volatile in relative terms: a channel on which to base forecasts is far riskier. The raw standard deviation (110 against 38) would have suggested the exact opposite.<\/p>\n\n<h2 id=\"faq\">Frequently asked questions<\/h2>\n\n<h3>What are the main measures of dispersion?<\/h3>\n\n<p>The range, the variance, the standard deviation, the interquartile range and the coefficient of variation. Variance, standard deviation and coefficient of variation are based on the distance of the data from the mean; the interquartile range on the quartiles, which is why it is robust to outliers.<\/p>\n\n<h3>What is the difference between variance and standard deviation?<\/h3>\n\n<p>The standard deviation is the square root of the variance. They measure the same thing, but the variance is expressed in the square of the data's unit (sessions squared), the standard deviation in the same unit (sessions): that is why it is much easier to read and communicate.<\/p>\n\n<h3>Why does R divide by n \u2212 1 and not by n?<\/h3>\n\n<p>Because var() and sd() estimate the variability of a population from a sample: dividing by n would systematically underestimate the true variance, and n \u2212 1 corrects that bias. If the data are the whole population, you divide by n.<\/p>\n\n<h3>When should you use the coefficient of variation?<\/h3>\n\n<p>When comparing the variability of quantities on different scales: two sites with different volumes, two channels, metrics with different units. The CV is the standard deviation divided by the mean, a pure number read as a percentage. It loses meaning with means close to zero or with data that can be negative.<\/p>\n\n<h3>What does platykurtic mean?<\/h3>\n\n<p>A distribution flatter than the normal, with lighter tails: the kurtosis is below 3 (the excess kurtosis below 0). The opposite is a leptokurtic curve, more peaked and with heavier tails; the normal is mesokurtic.<\/p>\n\n<h3>Which measure of dispersion should you use when there are outliers?<\/h3>\n\n<p>The interquartile range, which measures the width of the middle half of the data and therefore ignores the tails. Variance, standard deviation and range are instead inflated even by a single extreme value, such as a traffic spike or a session left open by a bot.<\/p>\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"What are the main measures of dispersion?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"The range, the variance, the standard deviation, the interquartile range and the coefficient of variation. Variance, standard deviation and coefficient of variation are based on the distance of the data from the mean; the interquartile range on the quartiles, which is why it is robust to outliers.\"}}, {\"@type\": \"Question\", \"name\": \"What is the difference between variance and standard deviation?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"The standard deviation is the square root of the variance. They measure the same thing, but the variance is expressed in the square of the data's unit (sessions squared), the standard deviation in the same unit (sessions): that is why it is much easier to read and communicate.\"}}, {\"@type\": \"Question\", \"name\": \"Why does R divide by n \u2212 1 and not by n?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Because var() and sd() estimate the variability of a population from a sample: dividing by n would systematically underestimate the true variance, and n \u2212 1 corrects that bias. If the data are the whole population, you divide by n.\"}}, {\"@type\": \"Question\", \"name\": \"When should you use the coefficient of variation?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"When comparing the variability of quantities on different scales: two sites with different volumes, two channels, metrics with different units. The CV is the standard deviation divided by the mean, a pure number read as a percentage. It loses meaning with means close to zero or with data that can be negative.\"}}, {\"@type\": \"Question\", \"name\": \"What does platykurtic mean?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"A distribution flatter than the normal, with lighter tails: the kurtosis is below 3 (the excess kurtosis below 0). The opposite is a leptokurtic curve, more peaked and with heavier tails; the normal is mesokurtic.\"}}, {\"@type\": \"Question\", \"name\": \"Which measure of dispersion should you use when there are outliers?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"The interquartile range, which measures the width of the middle half of the data and therefore ignores the tails. Variance, standard deviation and range are instead inflated even by a single extreme value, such as a traffic spike or a session left open by a bot.\"}}]}<\/script>\n\n<hr \/>\n\n<p>Range, variance, standard deviation, interquartile range, coefficient of variation, kurtosis: we can now say not only <em>where<\/em> the centre of a distribution lies, but how tightly the data cluster around it and what shape they take. It is the minimum vocabulary to describe any set of data &mdash; and the springboard for the next step: modelling it with a probability distribution, starting with the most famous of all, the <a href=\"https:\/\/www.gironi.it\/blog\/en\/the-normal-distribution\/\">normal distribution<\/a>, where the mean and the standard deviation become the only two numbers that say almost everything.<\/p>\n\n<hr \/>\n\n<h3>You might also like<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.gironi.it\/blog\/en\/descriptive-statistics-measures-of-position-and-central-tendency\/\">Descriptive Statistics: Measures of Position and Central Tendency<\/a><\/li>\n<li><a href=\"https:\/\/www.gironi.it\/blog\/en\/the-normal-distribution\/\">The Normal Distribution<\/a><\/li>\n<li><a href=\"https:\/\/www.gironi.it\/blog\/en\/anomaly-detection-how-to-identify-outliers-in-your-data\/\">Anomaly Detection: How to Identify Outliers in Your Data<\/a><\/li>\n<\/ul>\n\n<hr \/>\n\n<h3 id=\"further-reading\">Further Reading<\/h3>\n\n<p>If you want a gentle yet rigorous introduction to the concepts behind descriptive statistics\u2014including variability, distributions, and the art of making sense of data\u2014<a href=\"https:\/\/www.amazon.it\/dp\/8806246623?tag=consulenzeinf-21&#038;ascsubtag=descriptive-statistics-measures-of-variability-or-dispersion\" rel=\"nofollow sponsored noopener\" target=\"_blank\"><em>The Art of Statistics<\/em><\/a> by David Spiegelhalter is an excellent starting point. Spiegelhalter has the rare ability to explain statistical concepts without dumbing them down, and his treatment of uncertainty and dispersion is particularly illuminating.<\/p>","protected":false},"excerpt":{"rendered":"<p>Two sites, two charts of daily sessions. The first swings by almost 400 sessions a day, the second by just 52: one would be tempted to call the first far less stable.The opposite is true, and to notice it the mean is not enough: we need to know how far the data stray from it. &hellip; <a href=\"https:\/\/www.gironi.it\/blog\/en\/descriptive-statistics-measures-of-variability-or-dispersion\/\" class=\"more-link\">Leggi tutto<span class=\"screen-reader-text\"> &#8220;Standard Deviation and CV: when the mean alone deceives you (SEO case studies)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[161],"tags":[],"class_list":["post-3468","post","type-post","status-publish","format-standard","hentry","category-statistics"],"lang":"en","translations":{"en":3468,"it":1003},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"Paolo Gironi","author_link":"https:\/\/www.gironi.it\/blog\/author\/autore-articoli\/"},"uagb_comment_info":4,"uagb_excerpt":"Two sites, two charts of daily sessions. The first swings by almost 400 sessions a day, the second by just 52: one would be tempted to call the first far less stable.The opposite is true, and to notice it the mean is not enough: we need to know how far the data stray from it.&hellip;","_links":{"self":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/comments?post=3468"}],"version-history":[{"count":5,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3468\/revisions"}],"predecessor-version":[{"id":4475,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/posts\/3468\/revisions\/4475"}],"wp:attachment":[{"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/media?parent=3468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/categories?post=3468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gironi.it\/blog\/wp-json\/wp\/v2\/tags?post=3468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}