How do you check the relationship between two continuous features, and between two categorical features?
- Exam domain
- Data Processing20% of the exam
- Difficulty
- Medium
- In this mock
- 10 questions on this domainPractise this domain
Why the exam asks this
Data Processing (20% of the exam)
Objective in the exam guide: Compare two categorical or two continuous features using the appropriate method
Comparing feature pairs is named.
Why C is the answer
Correlation for continuous pairs; crosstab or chi-square for categorical
Correlation and scatter plots describe continuous pairs. Cross-tabulation and chi-square tests describe association between categories.
Remember: Match the method to feature types.
How it works
Pairwise analysis depends on feature types.
In detail
- Continuous: correlation, scatter.
- Categorical: crosstab, chi-square.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. A bar chart for both, comparing the counts in each bucket side by side on one axisWrongMost tempting
Bar charts do not show pairwise relationships well.
Why it tempts: Bar charts are everywhere.
B. Mean imputation for bothWrong
Imputation fills gaps; it does not compare.
C. Correlation for continuous pairs; crosstab or chi-square for categoricalRight
Match the method to feature types.
D. One-hot encode both and sum the columnsWrong
Summing encodings is meaningless.
Use case
An illustrative scenario, not a real incident.
Illustrative: df.stat.corr shows income and spend correlate at 0.7; df.stat.crosstab shows plan versus region.
See it in different ways
flowchart TD
Q{"What types are they?"}
Q -->|"Both continuous"| A0["Correlation, scatter"]
Q -->|"Both categorical"| A1["Crosstab, chi-square"]How to read this chart
- At "What types are they?": if "Both continuous", go to "Correlation, scatter"; if "Both categorical", go to "Crosstab, chi-square".
sequenceDiagram participant P0 as Analyst participant P1 as Spark P0->>P1: stat.corr income, spend P0->>P1: stat.crosstab plan, region P1-->>P0: results
How to read this chart
- 1. Analyst sends "stat.corr income, spend" to Spark.
- 2. Analyst sends "stat.crosstab plan, region" to Spark.
- 3. Analyst gets a reply from Spark: "results".