How do you determine if two variables are independent?

Instruction: Explain methods to assess the independence of two variables in a dataset.

Context: This question assesses the candidate's understanding of statistical relationships and their ability to test for independence between variables, which is crucial for certain types of statistical analysis.

Updated

Example Answer

Two variables are independent when their joint distribution factors into their marginal distributions. The way I investigate that depends on the data. For categorical variables, a contingency table and a chi-square independence test may be appropriate, provided the expected counts and sampling design support it. With sparse counts, I would consider an exact test instead.

For numeric variables, a scatterplot and correlation are useful first checks, but zero Pearson correlation does not establish independence. If X is uniform from minus one to one and Y equals X squared, their correlation is zero, yet knowing X determines Y. I would investigate plausible nonlinear relationships too. Finally, failing to reject an independence test means the available data did not establish dependence at that threshold; it is not proof that no dependence exists.

Why this works

The definition, diagnostic choice, and counterexample support different parts of the answer. It avoids treating a low-powered test as confirmation.

Follow-up to prepare for

How would repeated observations from the same person affect an independence test?

Related Questions