Home  >  Article  >  What is the difference between categorical variables and numerical variables?

What is the difference between categorical variables and numerical variables?

王林
王林Original
2020-05-31 13:48:5923186browse

What is the difference between categorical variables and numerical variables?

Numerical variables refer to values ​​that can take a series of numbers. These values ​​are meaningful for operations such as addition, subtraction, and averaging, while categorical variables are for the above The operation is meaningless.

Numerical variables can be divided into the following two categories:

1. Discrete variables (discrete)

The value can only be calculated using natural numbers or integer units. The values ​​are discontinuous, and there are no other values ​​between two adjacent values. The value of this variable is generally obtained using the counting method.

2. Continuous variable (continuous)

can take any value within a certain range. Its value is continuous. Two adjacent values ​​​​can be infinitely divided, that is, infinite numbers can be taken. numerical value. Such as height, length of rope, etc.
Compared with discrete variables, continuous variables have the concept of "true zero", so multiplication and division operations can be performed.

Categorical variables can be divided into the following two categories:

1. Ordered categorical variables (ordinal)

Describes the level or order of things. The variable value can be numerical or Character type can be used to compare the pros and cons, such as the degree of liking: like very much, average, dislike.

2. Unordered categorical variables (nominal)

There is no order difference between the values. They are only used for classification and can be divided into two-category variables and multi-category variables. Two-category variables refer to All data are divided into two categories, such as male and female, right and wrong, yin and yang, etc. The binary variable is a special categorical variable with its own unique analysis method. Multi-categorical variables refer to two or more categories, such as blood type is divided into A, B, AB, O.

The difference between ordered categorical variables and unnecessary categorical variables is that the former is meaningful for "comparison" operations, while the latter is meaningless for "comparison" operations.

The above is the detailed content of What is the difference between categorical variables and numerical variables?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn