Data Types
Categorical Type   Numeric Type  
Data Types, in statistics, allow us to organize and select appropriate processing procedures and descriptors. There are two major data types: Categorical (Qualitative) and Numeric (Quantitative). It is convenient to represent data (data sets) by variables. Thus a variable can also have its type (categorical or numeric). Terms such as variable, sample, set, or sometimes column can be used to refer to a collection of statistical data being analyzed. In this learning resource, most frequently, terms variable or sample are used. "Level of measurement or scale of measure is a classification that describes the nature of information within the values assigned to variables." [Wikipedia-Level of measurement]
Categorical Type
Categorical (qualitative) variables may be of nominal or ordinal type. The unique instances of a catagorical variable constitue the domain (meta-categories) of the variable.
Nominal Type
A nominal type represents the least organized data, which are collections of text tokens, tags, symbols, etc., that are not functionally related, except for belonging to particular collection or—collection type (family).
Analytic descriptors that are used to analyze nominal data include: frequency distribution, and mode. The frequency distribution shows the counts of all the categories, contained in the sample or population. The mode identifies the category, having the highest frequency (if any). Multi-dimensional variables can be summarized, using contingenct table (cross-tabultaion). Typical operators that can be applied to nominal data are: = (equal), ≠ (not equal), ∈ (is in), ∉ (is not in), ⊂ (belongs to), ⊄ (does not belong to), ⊆ (belongs to or is equivalent to), ⊈ (does not belong to and is not equivalent to).
Nominal Type Example
The manager of the local bookstore at the University of Statistics asked randomly selected students for their color preference of popular tee-shirts the he is about to order. He received the following sample:
  CP = {"blue", "blue", "green", "red", "green", "yellow", "brown", "blue", "white", "blue", "yellow", "red, "green", "blue", "green", "brown"}
This is a sample selected from a nominal population. Variable CP is of the nominal type. It has the following domain, D(CP):
  D(CP) = {"blue", "green", "red", "yellow", "brown", "white", "tan"}
Notice that the domain may include categories that are not present in the sample but are contained in the population from which the sample has been selected (see the sample & population page). The domain is either natural or defined intentionally for the experiment.
Ordinal Type
Ordinal data can be characterized by some kind of intensity, level, or weight. Instances of such a data type can be arranged in a particular order (ascending or descending). However, the distance between consecutive categories is not known.
Analytic descriptors that are used to analyze ordinal data include those that can be applied to the nominal data plus: median., percentiles, and rank. The median is a middle category. It separates the data set in such a way that there are approximately 50% values below it and 50% above it. In many cases, such a median can't be reasonably determined. The operators that can be applied to ordinal data are those for the nominal data plus the relational operators (< ,≤, > ≥).
Ordinal Type Example
In a perceptive test, the experimentor asked 12 randomly selected individuals to assess the speed of a moving object, using three categories: "slow", "steady", "fast". The test outcomes are as follows:
  Speed = {"fast", "steady", "slow", "fast", "steady", "steady", "fast", "slow", "slow" ,"fast", "slow", "slow"}
Notice that in this data set, the categories have order: "slow" < "steady" < "fast". This sample is selected from an unkown, ordinal population. Variable Speed is of the ordinal type. It has the following domain, D(Speed):
  D(Speed) = {"slow", ""slow", "fast"}
In this experiment, domain {"slow", ""slow", "fast"} is considered to be complete.
Numeric Type
Numeric (quantitative) variables may be of the discrete or continuous type. Analytic descriptors that are used to analyze numeric data include those that can be applied to the ordinal data plus: the mean, standard deviation. Multi-dimensional variables can be summarized, using covariance, coefficient of correlation, and scatter diagrams.
Discrete Type
The domain of the discrete variables is a subset or full set of integers (ℤ). In many cases, the variables represent some kind of counting.
Discrete Type Examples
Example 1:
Consider outcomes of rolling a die. The following data set comes from rolling the die 12 times:
  Roll = {3, 4, 1, 2, 3, 6, 3, 1, 5 ,4, 4, 4}
Notice that this data set is also ordinal. The values of this variable have order: 1 < 2 < 3 ... . This sample is selected from a kown, discrete population. Variable Roll is of the discrete type. It has the following domain, D(Roll):
  D(Speed) = {1, 2, 3, 4, 5, 6}
Example 2:
Suppose that we collect batches of 10 tires selected randomly from a production line, each during a night shift. We then count the number of defective tires.
  DefectCount = {1, 0, 0, 2, 1, 0, 0, 0, 0 ,5}
This sample is selected from a kown, discrete population. Variable DefectCountis of the discrete type. It has the following domain, D(Roll):
  D(DefectCount) = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
In a batch of 10 tires, there may be 0, 1, 2, ..., 10 defective tires.
Continuous Type
The domain of a continuous variable is a subset or full set of the real numbers (ℤ). Typically, the continuous variables are results of some kind of measurement. Multi-dimensional, continues variables can also be analyzed using regression models.
Continuous Type Examples
Example 1:
As a quality control engineer, your task is to measure the diameter [in millimeters] of a part made by 8 randomly selected lathe operators. The expected diameter (μ) is equal 10 mm.
  Dia = {10.0061, 10.0047, 9.9851, 10.0076, 10.0016, 9.9893, 9.9976, 9.9938}
The values of this variable come from a real (ℝ) domain. Although the range of the values is quite narrow but there is no pre-defined upper bound. Thus we assume here a theoretical domain of positive real numbers.
  D(Dia) = (0, +)
Example 2:
Suppose that we want to analyze the error (deviation) of the above measurements (Example 1) from their expected value (μ=10), Dia - μ:
  Err = {0.0061, 0.0047, -0.0149 0.0076, 0.0016, -0.0107, -0.0024, -0.0062}
The values of this variable come from a real (&Ropf;) domain. Although the range of the values is quite narrow but there are no pre-defined lower and upper bounds. Thus we assume here a theoretical domain of all real numbers, D(Err):
  D(Err) = (-∞, +) = ℝ

References
  Wikipedia-Level (2020). Level of measurement. URL - Source
  Wikipedia-Statistical-Data (2020). Statistical data type. URL - Source