Rows are not automatically comparable observations
Two files can have the same number of rows while covering different dates. Pairing the first value from one file with the first from the other would then measure an accidental arrangement, not the relationship you intended to study. This worksheet first creates a union-date audit and only then selects rows where both dated values are present.
The output shows the selected sample as well as the coefficient. A date that appears in only one series remains in the audit; so does a shared date with a missing value. You can see what was excluded before deciding whether this small calculation answers your research question. The site’s separate offer is optional and has no role in the result.
Read FRED observation dates and missing markers as supplied
The Federal Reserve Bank of St. Louis documents FRED observations with a date and a string value. Its release-observations documentation identifies a period as a missing value and keeps series metadata such as frequency, units and seasonal adjustment separate. This worksheet accepts the dot convention but uses a deliberately small two-column input, not a direct API connection or a complete FRED export parser.
An observation date is not the time you downloaded a file or necessarily a real-time market close. Preserve the source’s period convention and saved vintage. Do not shift a date-only observation from UTC to New York or invent a midnight timestamp. Different frequency or date-basis labels withhold the coefficient here, while the date audit remains available.
Sources: Federal Reserve Bank of St. Louis — FRED release observations documentation.
An inner sample needs an outer audit
The tool reports every date appearing in either input. It labels dates found only in X, dates found only in Y, dates with one or two missing values, and complete pairs. Only the last group reaches the coefficient. The input may be unsorted, but duplicate dates are rejected instead of choosing one value silently.
In the example,15 October appears only in X and its supplied value is a dot. There is no Y record to pair with it.20 October appears only in Y. Neither is a zero, a holiday inferred by the tool or a row copied from the previous date. Four other dates have complete values in both series, so the selected sample is four pairs.
What the coefficient calculates
For the selected pairs, subtract each series mean from its values. Multiply matching deviations and sum them to obtain Sxy. Sum squared deviations separately to obtain Sxx and Syy. Pearson r is Sxy divided by the square root of Sxx times Syy. NIST’s documentation gives this linear-association formula; this worksheet does not turn it into a significance test.
The implementation forms the equivalent centred sums with exact scaled integers before converting the final ratio to a floating-point coefficient. It displays six decimal places. Exact decimal parsing avoids losing a small difference merely because values share a large offset, but the final square root and displayed coefficient are numerical approximations. A displayed 1.000000 can therefore include a value slightly below one.
Sources: NIST Dataplot — Pearson dissimilarity documentation.
A perfect fictional relationship is useful for checking arithmetic
The complete X values are 1,2,4 and 5; their mean is 3. The corresponding Y values are 2,4,8 and 10; their mean is 6. X deviations are−2,−1,1,2 and Y deviations are−4,−2,2,4. The sums are Sxx=10, Syy=40 and Sxy=20, giving 20÷√400=1.
This constructed proportional relationship is an arithmetic check, not evidence about any assets. Change only the unmatched Y value on 20 October and the coefficient remains unchanged because that row is outside the disclosed sample. Change a paired value and the coefficient can change. The distinction demonstrates why the selected date list belongs beside the answer.
| Paired date | X | Y | Included |
|---|---|---|---|
| 2026-10-13 | 1 | 2 | Yes |
| 2026-10-14 | 2 | 4 | Yes |
| 2026-10-16 | 4 | 8 | Yes |
| 2026-10-19 | 5 | 10 | Yes |
Undefined and withheld are not zero correlation
A constant selected series has no variation, so the denominator is zero and this coefficient is undefined. Fewer than three complete pairs leave the result unavailable under the worksheet’s own reporting threshold. That threshold is not a universal statistical law: two nonconstant points can produce a mathematical coefficient, but they provide an especially uninformative sample for this report.
Missing metadata produces a different state, metadata_comparison_withheld. The tool can still show the date matches without implying that those observations should be combined. Zero correlation is reserved for a defined calculation whose cross-deviation sum is zero. It does not mean independence or absence of a nonlinear relationship.
State whether the inputs are levels, changes or returns
The input labels preserve the transformation already applied to each series. The worksheet does not convert prices to returns, difference economic levels or remove a trend. Mixing descriptions is visible in the report, but even matching words cannot verify how the numbers were produced. Preserve the actual transformation method and vintage with your source reference.
The St. Louis Fed’s discussion of spurious correlation explains how common trends can make raw economic levels appear related. A large coefficient alone does not show an economic mechanism or causation. A sample selected by available dates may also differ from the full series. This small descriptive calculation supplies neither a p-value nor a trading or forecasting claim.
Sources: St. Louis Fed — Spurious correlation, FRED Blog July 2014 archive.
A matching date does not prove matching market coverage
One market may have a different calendar, observation window or publication convention from another. The tool does not know why a date is absent, and it does not treat every weekday as a trading day. The exact-date intersection is transparent, but you must still decide whether the underlying definitions are comparable.
If your intended study requires resampling, lagging a series or computing returns over equal intervals, prepare and document that dataset separately. A return across a four-day gap is not automatically comparable with a one-day return because their end dates match. This worksheet will not conceal that decision by forward-filling missing prices or inventing an unobserved value.
Keep the sample attached to the answer
Read the metadata state, number of complete pairs, excluded-date count and selected date range before the coefficient. The CSV includes the original and normalised values for the full union, so another reader can reconstruct the selection. It records unknown source completeness, causation and significance rather than supplying unsupported defaults.
The result is local to your browser, with no FRED key, account connection or upload. Formula-like text receives CSV protection. Editing any field invalidates the previous report; copying has a manual fallback. With JavaScript disabled, the worked pair table and full method remain readable, while an interactive coefficient is not produced.
Worked examples
Example 1
The fictional union contains six dates. Four have numbers in both series: X=[1,2,4,5] and Y=[2,4,8,10]. Their means are 3 and 6, squared-deviation sums 10 and 40, and cross-product sum 20, so r = 1.000000. 15 October has only an X record whose value is missing; 20 October appears only in Y. Those dates are disclosed and excluded, not filled. The example proves no market relationship.
Inspect example inputs
{
"x_id": "DEMO-X",
"x_frequency": "daily observations",
"x_date_basis": "source observation date; no timezone conversion",
"x_units": "DEMO units X",
"x_transform": "supplied levels",
"x_reference": "DEMO saved series X vintage A",
"y_id": "DEMO-Y",
"y_frequency": "daily observations",
"y_date_basis": "source observation date; no timezone conversion",
"y_units": "DEMO units Y",
"y_transform": "supplied levels",
"y_reference": "DEMO saved series Y vintage A",
"x_rows": "date|value\n2026-10-13|1\n2026-10-14|2\n2026-10-15|.\n2026-10-16|4\n2026-10-19|5",
"y_rows": "date|value\n2026-10-13|2\n2026-10-14|4\n2026-10-16|8\n2026-10-19|10\n2026-10-20|12"
}Questions about the method
Does a dot mean 0?
No. In this workflow it is missing, consistent with the cited FRED convention. An explicit numeric 0 is retained.
Why does changing an unmatched row not change r?
Only complete matching-date pairs enter the coefficient. The unmatched row stays in the union audit.
Can I interpret r as a forecast or a hedge ratio?
No. It is a descriptive linear-association statistic on the disclosed sample, without a causal model, out-of-sample validation or position-size calculation.
Primary sources and scope
- Federal Reserve Bank of St. Louis — FRED release observations documentationChecked 2026-10-20. Observation-date and string-value fields, dot as missing, and separate series metadata. No API request or actual series values used.
- NIST Dataplot — Pearson dissimilarity documentationChecked 2026-10-20. Defines the underlying Pearson coefficient using centred sums. The worksheet computes r only, not the page’s dissimilarity transform.
- St. Louis Fed — Spurious correlation, FRED Blog July 2014 archiveChecked 2026-10-20. Primary indexed archive text explains shared trends and limits of causal interpretation. Direct individual post returned an inaccessible redirect; no claim of direct full-post reading.
Examples explain a method. They do not predict prices or establish where a trading service is available. Check the named source before relying on future schedules.