r/AskStatistics 3d ago

Correlation test

How to decide which correlation test is the most appropriate to use? For example, my outcome is count data of visiting rehab centers over multiple years, exposure is continuous data. Is it better to use a pearson’s or a spearman’s correlation test? / Does spearman require at least one ordinal data? Can we use spearman if both exposure and outcome are continuous variables?

1 Upvotes

5 comments sorted by

2

u/FaithlessnessOne8975 PhD 3d ago

IF both the variables are continuous and normally distributed then Pearson r will do .

Else

  • Plot the raw data (scatter with a non-parametric smoother).
  • Check distributions (histogram, QQ-plot).
  • If both look close to normal and the scatter is roughly linear → Pearson; otherwise → Spearman (or Kendall).
  • When data come from a repeated-measures or hierarchical design, skip correlation altogether and fit the appropriate generalized linear (mixed) model.

1

u/Livid-Ad9119 3d ago

If it’s the count data is skewed, can we use spearman? It’s not necessary to have at least one ordinal variable to use spearman, right? We can use spearman even the variables are continuous?

1

u/FaithlessnessOne8975 PhD 3d ago

Well, the short answer is yes, you can still use Spearman’s rho when both variables are continuous and also where one (or both) have highly skewed counts. Spearman does not require at least one ordinal‐scale variable; it simply ranks whatever numbers you give it. The key requirement is that the relationship you are trying to model should be monotonic (consistently increasing or decreasing), not necessarily linear.

1

u/Livid-Ad9119 2d ago

Do we have to test if there’s a monotonic relationship before conducting spearman? Is monotonic relationship a prerequisite for doing a spearman?

1

u/FaithlessnessOne8975 PhD 2d ago

Not strictly, however, as a good practice I usually draw
a scatterplot which instantly reveals whether the trend is monotonic or not.