What are categorical, discrete, and continuous variables?

Quantitative variables can be classified as discrete or continuous.

Categorical variable
Categorical variables contain a finite number of categories or distinct groups. Categorical data might not have a logical order. For example, categorical predictors include gender, material type, and payment method.
Discrete variable
Discrete variables are numeric variables that have a countable number of values between any two values. A discrete variable is always numeric. For example, the number of customer complaints or the number of flaws or defects.
Continuous variable
Continuous variables are numeric variables that have an infinite number of values between any two values. A continuous variable can be numeric or date/time. For example, the length of a part or the date and time a payment is received.

If you have a discrete variable and you want to include it in a Regression or ANOVA model, you can decide whether to treat it as a continuous predictor (covariate) or categorical predictor (factor). If the discrete variable has many levels, then it may be best to treat it as a continuous variable. Treating a predictor as a continuous variable implies that a simple linear or polynomial function can adequately describe the relationship between the response and the predictor. When you treat a predictor as a categorical variable, a distinct response value is fit to each level of the variable without regard to the order of the predictor levels. Use this information, in addition to the purpose of your analysis to decide what is best for your situation.

By using this site you agree to the use of cookies for analytics and personalized content.  Read our policy