Courseiva
Data Analysis →mediumMultiple Choice

DA0-002 Data Analysis Practice Question

A data analyst is working with a dataset containing a categorical variable 'Education Level' with categories: High School, Bachelor's, Master's, PhD. The analyst wants to include this variable in a regression model. Which encoding technique should the analyst use?

⚠ Common exam trap

The trap here is using label encoding for a nominal variable, which forces the model to treat categories as ordered numbers and can lead to incorrect coefficient estimates.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

One-hot encoding

One-hot encoding is the preferred method for nominal categorical variables in regression because it avoids imposing an artificial order or equal spacing. It creates separate binary indicators, allowing the model to estimate distinct effects for each education level. Label, binary, and ordinal encoding all introduce numerical relationships that may misrepresent the categorical nature of the data.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Binary encoding

    Why it's wrong here

    Binary encoding converts categories into binary code, reducing dimensionality but still imposing a numerical structure that may not be meaningful. It is often used for high-cardinality features, but for a small set of education levels, one-hot encoding is more interpretable and standard. Binary encoding can complicate interpretation in regression.

  • ✗

    Label encoding

    Why it's wrong here

    Label encoding assigns arbitrary integers to categories (e.g., High School=0, Bachelor's=1), which implies an ordinal relationship and equal spacing. For nominal data like Education Level, this can mislead the regression model into treating the categories as ordered. It is suitable for ordinal variables but not for this nominal variable.

  • ✗

    Ordinal encoding

    Why it's wrong here

    Ordinal encoding assigns ordered integers based on category rank, which is appropriate for ordinal variables like satisfaction levels. Education Level could be considered ordinal, but the analyst may not want to assume equal intervals between degrees. One-hot encoding is safer when the spacing between categories is not uniform or when the analyst wants to avoid imposing order.

  • ✓

    One-hot encoding

    Why this is correct

    One-hot encoding creates binary columns for each category, avoiding implying any ordinal relationship. For regression, it is appropriate for nominal categorical variables like Education Level, which has no inherent order. It allows the model to estimate a separate coefficient for each category, capturing differences without assuming a linear progression.

About these practice questions

This DA0-002 question is part of Courseiva's 1,004-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

This DA0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DA0-002 exam.