74
$\begingroup$

What is the difference between discrete data and continuous data?

$\endgroup$
7
  • 3
    $\begingroup$ Did you try Google first? For me, it gives this. $\endgroup$ Commented Jul 25, 2010 at 20:15
  • $\begingroup$ Here is a nice video which answers your question. youtube.com/watch?v=MIX3ZpzEOdM $\endgroup$
    – user67783
    Commented Jan 30, 2015 at 2:35
  • 4
    $\begingroup$ Just think digital vs analog. Same thing - different names. $\endgroup$
    – Pithikos
    Commented Jun 15, 2016 at 9:15
  • 1
    $\begingroup$ I truly don't know what the difference between "discrete" and "continuous" data. For some reasons, intro stat classes seem to really enjoy making students memorize rules to distinguish these two things. As far as I've been able to understand, the differences are not in the data--but in how we choose to model the data. $\endgroup$
    – user795305
    Commented Sep 24, 2017 at 5:06
  • 2
    $\begingroup$ This was the top result in Google, @robingirard. $\endgroup$
    – denson
    Commented Sep 28, 2017 at 10:21

7 Answers 7

64
$\begingroup$

Discrete data can only take particular values. There may potentially be an infinite number of those values, but each is distinct and there's no grey area in between. Discrete data can be numeric -- like numbers of apples -- but it can also be categorical -- like red or blue, or male or female, or good or bad.

Continuous data are not restricted to defined separate values, but can occupy any value over a continuous range. Between any two continuous data values, there may be an infinite number of others. Continuous data are always essentially numeric.

It sometimes makes sense to treat discrete data as continuous and the other way around:

  • For example, something like height is continuous, but often we don't really care too much about tiny differences and instead group heights into a number of discrete bins -- i.e. only measuring centimetres --.

  • Conversely, if we're counting large amounts of some discrete entity
    -- i.e. grains of rice, or termites, or pennies in the economy -- we may choose not to think of 2,000,006 and 2,000,008 as crucially
    different values but instead as nearby points on an approximate
    continuum.

It can also sometimes be useful to treat numeric data as categorical, eg: underweight, normal, obese. This is usually just another kind of binning.

It seldom makes sense to consider categorical data as continuous.

$\endgroup$
5
  • $\begingroup$ @walktalky as @jeromy alludes to, in psychology at least, categorial variables such as reponses to questions are often presumed as being a representation of a underlying trait, so in that sense categorial data is sometimes taken as being continuous. $\endgroup$ Commented May 27, 2011 at 9:31
  • $\begingroup$ @richiemorrisroe One could nitpick about the difference between the data and the putative trait, but of course you are right. Some very interesting further points were made in response to this follow-up question. $\endgroup$
    – walkytalky
    Commented May 27, 2011 at 11:00
  • $\begingroup$ thanks for the link, those answers are indeed very interesting. $\endgroup$ Commented May 27, 2011 at 11:08
  • 1
    $\begingroup$ > "There may potentially be an infinite number of those values, but each is distinct and there's no grey area in between" -- it's actually perfectly possible to have a discrete distribution with distinct values, and yet at the same time, for any two distinct values you pick, always have more values between them ('grey area' in a sense). They don't come up all that often in practice, but it's perfectly possible for them to come up for real; indeed I can think of two distinct (if related) examples that can easily arise. $\endgroup$
    – Glen_b
    Commented Aug 22, 2013 at 2:30
  • $\begingroup$ so to clarify, even if you had 10 billion rows of ohlc data for a stock asset, it would be still be considered discrete? but then cant the price of an asset be anything between 1 to infinity, how to think in this type of situation? $\endgroup$
    – PirateApp
    Commented Jan 30, 2018 at 12:35
31
$\begingroup$

Data is always discrete. Given a sample of $n$ values on a variable, the maximum number of distinct values the variable can take is equal to $n$. See this quote

All actual sample spaces are discrete, and all observable random variables have discrete distributions. The continuous distribution is a mathematical construction, suitable for mathematical treatment, but not practically observable. E.J.G. Pitman (1979, p. 1).

Data on a variable are typically assumed to be drawn from a random variable. The random variable is continuous over a range if there is an infinite number of possible values that the variable can take between any two different points in the range. For example, height, weight, and time are typically assumed to be continuous. Of course, any measurement of these variables will be finitely accurate and in some sense discrete.

It is useful to distinguish between ordered (i.e., ordinal), unordered (i.e., nominal),
and binary discrete variables.

Some introductory textbooks confuse a continuous variable with a numeric variable. For example, a score on a computer game is discrete even though it is numeric.

Some introductory textbooks confuse a ratio variable with continuous variables. A count variable is a ratio variable, but it is not continuous.

In actual practice, a variable is often treated as continuous when it can take on a sufficiently large number of different values.

--

Reference:

  • Pitman, E. J. G. 1979. Some basic theory for statistical inference. London: Chapman and Hall.

  • Note: I found the quote in the introduction of Chapter 2 of Murray Aitkin's book Statistical Inference: An Integrated Bayesian/Likelihood Approach

$\endgroup$
3
  • 15
    $\begingroup$ A probability, too, is a "mathematical construction" and not "directly observable." Does this mean that probability does not exist? Overall, this interesting reply seems based on an untenable premise that data should be characterized by the values they do have rather than by the values a mathematical model allows them to have. The latter is the crucial characteristic, not the former. This all suggests that what matters in the continuous/discrete distinction is how we think about the data (that is, how we model them). $\endgroup$
    – whuber
    Commented Jul 9, 2012 at 12:34
  • 5
    $\begingroup$ There's a clever little fable illustrating @whuber's point: Lord (1953), "On the statistical treatment of football numbers", American Psychologist, 8, pp750-51. $\endgroup$ Commented Jun 18, 2014 at 8:37
  • 2
    $\begingroup$ Thank you,@Scortchi. Web versions are available through a Google scholar search. Lord is addressing a misconception, hotly debated 60 years ago, about the extent to which "measurement theory" should influence (or even limit the scope of) statistical analysis. My point was a different one about the distinction between model constructs and observations. $\endgroup$
    – whuber
    Commented Jun 18, 2014 at 13:56
14
$\begingroup$

Temperatures are continuous. It can be 23 degrees, 23.1 degrees, 23.100004 degrees.

Sex is discrete. You can only be male or female (in classical thinking anyways). Something you could represent with a whole number like 1, 2, etc

The difference is important as many statistical and data mining algorithms can handle one type but not the other. For example in regular regression, the Y must be continuous. In logistic regression the Y is discrete.

$\endgroup$
1
  • 7
    $\begingroup$ When you record temperature to the nearest degree, it can be considered discrete--and perhaps has to be so considered for certain forms of analysis. Also, in "regular" (OLS?) regression, $Y$ need not be continuous: many--and practically all its useful properties--apply to many types of discrete data, even binary responses. What these points and counterpoints begin to suggest is that data are not necessarily discrete or continuous, but rather statistical procedures are discrete or continuous. $\endgroup$
    – whuber
    Commented Jul 9, 2012 at 12:38
10
$\begingroup$

Discrete Data can only take certain values.

Example: the number of students in a class (you can't have half a student).

Continuous Data is data that can take any value (within a range)

Examples:

  • A person's height: could be any value (within the range of human heights), not just certain fixed heights,
  • Time in a race: you could even measure it to fractions of a second,
  • A dog's weight,
  • The length of a leaf,
  • The weight of a person,
$\endgroup$
2
1
$\begingroup$

In the case of database, we would always store the data in discrete even the nature of the data is continuous. Why should I emphasize the nature of data? We should take the distribution of data that could help us to analyze the data. IF the nature of data is continuous, I suggest you to use them by continuous analysis.

Take an example of continuous and discrete: MP3. Even the type of "sound" is analogy, if stored by digital format. We should analyze it always in a analogy way.

$\endgroup$
1
  • $\begingroup$ This is very questionable. Different data types exist in a DBMS for their reasons. For a particular DBMS it can be beneficial to store floats as integers to not lose on precision, but it's not generally so: some have exact number format that is arbitrarily precise and you don't have to use conversion (like, /1000) in each query. $\endgroup$ Commented Oct 21, 2022 at 12:56
0
$\begingroup$

On the one hand, from a practical point of view I do agree with Jeromy Anglim's answer. In the end we are most of the time dealing with discrete variables – although from a theoretical point of view they are continuous – and that has a real impact for instance for classification. Recall Strobl's paper indicating that Random Forests is biased towards variables with multiple cutting points (higher accuracy but potentially similar nature). From my personal experience probabilistic neural networks may present also a bias when variables present different accuracy unless they are of the same type (i.e., continuous). On the other hand, from a theoretical point of view the classical classification (e.g., continuous, discrete, nominal etc.) is, IMHO, right. In accordance I think that the source name of Quinlan’s paper describing the M5 algorithm, which is a ‘regressor’, is a great choice. So the definition and the implications of continuous vs. discrete are relevant depending on the ‘environment’.

Refs:

Quinlan J.R. (1992). Learning with continuous classes. In: The 5th Australian Joint Conference on AI. Sydney (Australia), 343–348.

Strobl C., Boulesteix A.-L., Zeileis A., & Hothorn T. (2007). Bias in random forest variable importance measures: illustrations, sources and a solution. BMC Bioinformatics, 8, 25. doi: 10.1186/1471-2105-8-25

$\endgroup$
-1
$\begingroup$

Discrete data take particular values, while continuous data are not restricted to separate values.

Discrete data are distinct and there is no grey area in between, while continuous data occupy any value over a continuous data value.

$\endgroup$

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