# Bivariate correlation (/docs/analyses/correlation)



## When to use it [#when-to-use-it]

Use a correlation when you want the strength and direction of a relationship, not a prediction equation. For example: do students who study more hours also have higher exam scores, and do more anxious students have lower scores?

Pearson’s r describes a straight-line relationship. Spearman’s ρ and Kendall’s τ are method options on this same page. They rank the scores first, so a curve or a few extreme scores moves them less.

## Assumptions [#assumptions]

Pearson’s r assumes a straight line and is pulled around by outliers. Spearman and Kendall do not assume a straight line. Tensr does not test normality or linearity inside this procedure.

## Running it in Tensr [#running-it-in-tensr]

<Steps>
  <Step>
    Analyze → Correlate → Bivariate. In chat: “Correlate hours, anxiety, and score.”
  </Step>

  <Step>
    Choose the numeric columns. If you leave columns empty, Tensr uses the numeric columns it can find.
  </Step>

  <Step>
    Method starts at pearson. Tail starts at two_tailed. Significance alpha starts at 0.05. Flag significant starts off.
  </Step>
</Steps>

## Options [#options]

<TypeTable
  type="{
  columns: {
    type: 'string[]',
    description: 'Numeric columns. Optional. At least two are required once empty columns are resolved.',
  },
  method: {
    type: 'string',
    description: 'pearson, spearman, or kendall.',
    default: 'pearson',
  },
  significance_alpha: {
    type: 'number',
    description: 'Cutoff used when flagging pairs. Shown as Significance α.',
    default: '0.05',
  },
  tail: {
    type: 'string',
    description: 'two_tailed or one_tailed. One-tailed halves the two-sided p when the coefficient is positive, and uses the upper tail when it is negative.',
    default: 'two_tailed',
  },
  flag_significant: {
    type: 'boolean',
    description: 'When on, the result also stores a p-value matrix and a true/false significance matrix.',
    default: 'false',
  },
  missing_values: {
    type: 'string',
    description: 'pairwise or listwise. The matrix is pandas’ pairwise correlation, which drops missing values per pair.',
    default: 'pairwise',
  },
  decimal_places: {
    type: '0–6',
    description: 'Report output. Decimal places.',
    default: '3',
  },
  apa_format: {
    type: 'boolean',
    description: 'Report output. APA-style p-values.',
    default: 'true',
  },
  include_charts: {
    type: 'boolean',
    description: 'Report output. Shared chart switch.',
    default: 'true',
  },
}"
/>

## Reading the output [#reading-the-output]

Hours, anxiety, and exam score for the 96 students. Flag significant is off, so the coefficients are printed without stars. Hours was built to rise with score. Anxiety was built to fall with it. Neither link is tight.

|         |  hours | anxiety |  score |
| ------- | -----: | ------: | -----: |
| hours   |      1 |  -0.067 |  0.327 |
| anxiety | -0.067 |       1 | -0.374 |
| score   |  0.327 |  -0.374 |      1 |

|         | hours | anxiety |   score |
| ------- | ----: | ------: | ------: |
| hours   |     — |    .516 |    .001 |
| anxiety |  .516 |       — | \< .001 |
| score   |  .001 | \< .001 |       — |

Pearson correlations among 3 numeric variable(s), 96 complete rows. Pearson correlations among 3 numeric variable(s), 96 complete rows. Metrics: Method = Pearson; Complete rows = 96; Significance α = 0.05.

## Reporting (APA 7) [#reporting-apa-7]

Pearson correlations among 3 numeric variable(s), 96 complete rows. Report the estimate in the table. This procedure is not summarised by one p-value.

## Coming from SPSS [#coming-from-spss]

Analyze → Correlate → Bivariate.

SPSS puts Pearson, Spearman, and Kendall in one dialog, which matches this page. SPSS can also print a scatterplot from Chart Builder. Tensr’s chart switch is the shared `include_charts` option.

## Related [#related]

One relationship with other columns held constant is [partial correlation](/docs/analyses/partial-correlation). Predicting a score from several columns is [linear regression](/docs/analyses/linear-regression).
