相関分析ツールの使い方
How to Use the Correlation Tool
2変数間の相関関係の分析から、データの保存・再読み込みまでの操作方法をまとめています。
This page explains how to analyze the correlation between two variables and how to save or reload your data.
① X・Yデータ入力 ② 変数名とタイトル ③ 回帰線とサイズ ④ 「計算する」を押す ⑤ 変更したら再計算 ⑥ 結果を保存 ⑦ Excel/CSV読み込み ⑧ クリアボタン ⑨ データの取り扱い
① Enter X/Y Data ② Names & Title ③ Regression & Size ④ Click Calculate ⑤ Recalculate After Edits ⑥ Save Results ⑦ Import Excel/CSV ⑧ Clear Buttons ⑨ Data Handling
① X・Yのデータを入力する
① Enter X and Y Data
「Xデータ」「Yデータ」欄にそれぞれ数値を入力します。カンマ・改行・スペース(全角を含む)・タブのいずれでも区切れます。全角の数字・小数点・マイナス(12.5、−5など)も数値として読み取れます。X・Yは同じ件数で入力してください。入力した順に、1つ目同士、2つ目同士…が組になります(空行や1行の値の数は関係しません)。最低2組以上のデータが必要です。データは10,000組まで入力できます。
Enter values in the "X Data" and "Y Data" fields. Values can be separated by commas, line breaks, spaces (including full-width spaces), or tabs. Full-width digits, decimal points, and minus signs (such as 12.5 and −5) are also read as numbers. X and Y must have the same number of values. Values are paired in the order entered: the 1st with the 1st, the 2nd with the 2nd, and so on (blank lines and the number of values per line do not matter). At least 2 pairs are required. You can enter up to 10,000 pairs.
桁区切りのカンマ(1,234 など)は値の区切りとして読まれ、1 と 234 の2つの値になります(エラーにはなりません)。Excelで桁区切りの表示形式にしているセルをコピーすると、カンマも一緒に貼り付けられるので、表示形式を外してからコピーしてください。
A thousands separator (such as in 1,234) is read as a separator between values, so it becomes two values, 1 and 234 (no error is shown). If you copy cells that use a thousands-separator number format in Excel, the commas are pasted too, so remove that format before copying.
② 変数名・タイトルを入力する
② Enter Variable Names and Title
X変数名・Y変数名はグラフの軸ラベルに反映されます(任意、空欄可)。グラフタイトルも任意で、空欄の場合は既定名になります(既定は "Correlation Analysis")。グラフタイトルは40文字までです。
The X/Y variable names are used as the chart's axis labels (optional). The chart title is also optional and defaults to a standard name when left blank (default: "Correlation Analysis"). The chart title is up to 40 characters.
③ 回帰直線・グラフサイズを設定する
③ Configure Regression Line and Chart Size
- 回帰直線を表示する:チェックを入れると、散布図に最小二乗法による回帰直線を重ねて表示します(既定はオン)。
- グラフに統計量を表示:チェックを入れると、グラフ右上にデータ数n・ピアソンの積率相関係数r・決定係数R²の枠を表示します(既定はオン)。画面のグラフ・グラフ画像の保存・Excel出力のすべてに反映されます。
- グラフサイズ:「自動」では標準サイズ(幅10.5×高さ5.6インチ)で描画します。「手動」を選ぶと幅・高さ(インチ、4〜20の範囲)を指定できます(既定は「自動」)。範囲外の値(0・負の数を含む)は4〜20に丸めて描画し、入力欄にも丸めた値を表示して、黄色の注意を表示します。幅・高さのどちらかが空欄のときは、両方とも標準サイズで描画し、黄色の注意を表示します。数値でない文字(abc など)や nan・inf は、欄名を示すエラーになり、計算しません。
- 軸の表示範囲:X・Y軸それぞれの最小・最大値をデータ値で指定できます(任意。既定は空欄=自動)。軸ごとに最小・最大の両方を入力してください。片方だけの入力や、最小が最大以上の場合は、その軸はデータに合わせて自動設定され、黄色の注意を表示します。数値でない文字(abc など)や nan・inf は、欄名を示すエラーになり、計算しません。
- Show regression line overlays a least-squares regression line on the scatter plot (default: on).
- Show statistics on chart shows a box with n, Pearson's r, and R² in the top-right of the chart (on by default). This applies to the on-screen chart, the saved image, and the Excel export.
- Chart Size: "Auto" uses a standard size (10.5 × 5.6 in); "Manual" lets you set width/height in inches (4–20) (default: Auto). Values outside this range (including 0 and negative numbers) are adjusted to 4 or 20, the adjusted value is shown in the field, and a yellow caution is displayed. If either the width or the height is left blank, the standard size is used for both, and a yellow caution is displayed. Text that is not a number (such as abc), nan, and inf cause an error naming the field, and no calculation is done.
- Axis Range lets you set the min/max for each axis in data units (optional; default: blank = auto). Enter both the min and max for an axis; if only one is entered, or the min is greater than or equal to the max, that axis auto-scales to the data and a yellow caution is displayed. Text that is not a number (such as abc), nan, and inf cause an error naming the field, and no calculation is done.
④ 「計算する」を押す
④ Click "Calculate"
散布図(+回帰直線)が表示され、グラフ右上には要点(データ数n・ピアソンの積率相関係数r・決定係数R²)が枠付きで表示されます(非表示にもできます)。ページ下部の「計算結果」には、スピアマンの順位相関係数や回帰直線の傾き・切片を含む詳細な数値が一覧表示されます。
A scatter plot (with an optional regression line) is displayed, with a compact summary box (n, Pearson's r, R²) in the top-right corner of the chart (it can be hidden). The "Results" section further down the page lists the full detail, including Spearman's ρ and the regression slope/intercept.
詳しい考え方・計算方法は、解説記事「相関係数とは?(新しいタブで開きます)」で説明しています。
For a detailed explanation of the concepts and calculations, see Correlation Coefficient (opens in a new tab).
⑤ 内容を変更したら、必ず「計算する」を押し直してください
⑤ After Any Change, Click "Calculate" Again
このツールは自動更新されません。X・Yのデータ、変数名・タイトル、回帰直線の表示、統計量の表示、グラフサイズ、軸の表示範囲など、いずれかを変更した場合、下の「計算する」を押すまで画面の結果・グラフは更新されません。データを直しただけの場合も、グラフの設定だけ変えた場合も同様です。
This tool does not update automatically. If you change any of the X/Y data, variable names/title, regression line display, statistics display, chart size, or axis range, the results and chart on screen will not update until you press "Calculate" again — whether you only edited the data or only changed a chart setting.
⑥ 結果を保存する
⑥ Save the Results
- グラフ画像を保存:表示中のグラフをPNG画像としてダウンロードします。
- Excel出力:入力データ・計算結果・グラフ画像を1つのExcelファイル(3シート構成)としてダウンロードします。
- CSV出力:入力データ・計算結果をCSVファイルとしてダウンロードします(グラフ画像は含まれません)。
- タイトルを入力している場合、グラフ画像(PNG)・Excel・CSVのファイル名はそのタイトル名になります(ファイル名に使えない記号は「_」に置き換わります)。空欄、または既定タイトル("Correlation Analysis")と同じ場合は、Excel・CSVは "correlation_result"、PNGは "correlation_chart" になります。
- Save Chart Image downloads the graph as a PNG.
- Export Excel downloads the input data, results, and chart in one file (3 sheets).
- Export CSV downloads the data and results without the chart image.
- If a chart title is entered, it is used as the file name for the chart image (PNG), Excel, and CSV. (Characters not allowed in file names are replaced with "_".) If the title is blank or the same as the default title ("Correlation Analysis"), the files are named "correlation_result" (Excel/CSV) and "correlation_chart" (PNG).
⑦ Excel/CSVから読み込む(インポート)
⑦ Import from Excel or CSV
本ツールから出力したExcel(.xlsx)またはCSV(.csv)ファイルをページ上部の「Excel / CSVから読み込む」から選択すると、X・Yデータ・X変数名・Y変数名・グラフタイトルが復元され、計算結果とグラフが表示されます。グラフの設定(回帰直線・統計量の表示・グラフサイズ・軸の表示範囲)はファイルに保存されないため、読み込み後は既定値(回帰直線と統計量の表示はオン、グラフサイズは自動、軸の表示範囲は空欄)に戻ります(アップロードは最大10MBまで)。データが10,000組を超えるファイルは読み込めません。
Select an .xlsx or .csv file previously exported from this tool under "Import from Excel or CSV" at the top of the page to restore its X/Y data, X/Y variable names, and chart title; the results and chart are then shown. The chart settings (regression line, statistics display, chart size, and axis range) are not saved in the file, so they return to their defaults after importing (regression line and statistics display on, chart size Auto, axis range blank) (max upload size: 10MB). Files with more than 10,000 pairs cannot be imported.
- 読み込めるファイル:このツールで出力したExcel(.xlsx)・CSV(.csv)です。以前の形式(項目名が日本語だけ・英語だけのもの)も読み込めます。
- 読み込むシート:シートの名前や順番は問いません。Excelファイルでは、ブックの中から、このツールの出力の形をしたシートを中身で探して読みます(シート名を変えたり、シートの順番を入れ替えたり、「Results」「Chart」シートを削除したりしても読み込めます)。同じ形のシートが複数あるときは、名前が「Input Data」(以前の出力は「入力データ」)のシートを、なければブックの並び順で最初のシートを読みます(お知らせは出ません)。
- 必須の項目:X・Yのデータ(「Xデータ」「Yデータ」の見出しと、その下のデータ)だけです。グラフタイトル・X変数名・Y変数名の行がないときは、既定値(空欄)を使い、そのことを計算結果の上にお知らせします。この3つの行は、1つずつでも、まとめてでも、すべて削除しても読み込めます(見つからなかった項目の名前は、お知らせにまとめて表示されます)。行があって値が空欄のときは、空欄として読み込みます(お知らせは出ません)。
- 項目名を書き換えたとき:項目名は「日本語 / English」の形で書かれています。日本語・英語の片方だけにしても読み込めます。かっこ・空白・「/」の全角と半角、大文字と小文字の違いは区別しません。行や列の順番を入れ替えても読み込めます(入力条件の行は「Xデータ」「Yデータ」の見出しより上に置いてください)。言い回しを変えた項目名は、その項目として読み込めません。同じ項目が2つ以上あるとエラーになります。知らない名前の行は読み飛ばします。
- 空のセルと数値でないデータ:X・Yがどちらも空の行は、データの終わりとして扱います。その行より後ろにまだデータがあるとき、X・Yの片方だけが空の行があるとき、数値でないデータ(文字・日付など)があるときは、行番号を示すエラーになります(最大5件まで表示)。
- Files you can import: .xlsx and .csv files exported from this tool. Files in earlier formats (item names in Japanese only or English only) can also be imported.
- Which sheet is read: the sheet name and the sheet order do not matter. For an Excel file, the tool looks through the workbook and reads the sheet whose content has the format of this tool's export (it still imports if you rename the sheet, reorder the sheets, or delete the "Results" and "Chart" sheets). If several sheets have that format, the sheet named "Input Data" (in earlier exports, "入力データ") is read; if there is none, the first such sheet in the workbook order is read (no notice is shown).
- Required items: only the X and Y data (the "X Data" and "Y Data" headings and the data below them). If the Chart Title, X Variable Name, or Y Variable Name row is missing, the default (blank) is used and a notice is shown above the results. These three rows can be deleted one at a time, several at once, or all together, and the file can still be imported (the names of the items that were not found are listed together in the notice). If the row is there but the value is blank, it is imported as blank (no notice).
- If you rename items: item names are written as "Japanese / English". Keeping only the Japanese or only the English part still works. Full-width and half-width parentheses, spaces, and slashes, and upper and lower case, are treated as the same. Rows and columns can be reordered (keep the condition rows above the "X Data" and "Y Data" headings). An item name reworded in other ways is not recognized as that item. If the same item appears more than once, an error is shown. Rows with unknown names are skipped.
- Empty cells and non-numeric data: a row where both X and Y are empty is treated as the end of the data. If there is more data after that row, if only one of X and Y is empty in a row, or if there is non-numeric data (text, dates, etc.), an error shows the line numbers (up to 5 are listed).
出力したファイルを書き換えて読み込む:出力したファイルの「Input Data」シート(CSVでは、先頭から「計算結果 / Results」の行の手前まで)を書き換えてから読み込むと、書き換えた内容で計算し直します。例えば、データの組(X・Y)の追加・削除、X変数名・Y変数名・グラフタイトルの変更ができます。
Editing an exported file before importing: you can edit the "Input Data" sheet of an exported file (in CSV, everything from the top down to just above the "計算結果 / Results" row) and then import it; the tool recalculates from the edited content. For example, you can add or delete X/Y pairs, or change the X Variable Name, Y Variable Name, or chart title.
- データを追加するときは、最後の組のすぐ下の行に、XとYを同じ行に組にして入力してください。空の行を挟んだり、X・Yの片方だけを入力したりするとエラーになります。データを削除するときは、行ごと削除して詰めてください。
- データは10,000組までです。超えるとエラーになります。
- 「Results」「Chart」シート(CSVでは「計算結果 / Results」から下の行)は、読み込みでは使いません。書き換えても反映されず、読み込んだあとに入力データから計算し直します。
- 項目名や見出し(「X変数名 / X Variable Name」「Xデータ / X Data」など)は変えないでください。変えたときの扱いは、上の「項目名を書き換えたとき」をご覧ください。
- 出力したファイルをExcelで編集するときの注意:Excel出力(.xlsx)のファイルを開き、.xlsxのまま上書き保存することをおすすめします(値も名前も変わりません)。CSVをExcelで開いて保存し直すと、Excelが内容を書き換えることがあります。保存形式は「CSV UTF-8(コンマ区切り)」「CSV(コンマ区切り)」のどちらでも読み込めますが、次のように変わります。
- 数値は、画面に表示されている桁数で保存されます(例:10.123456789012344 → 10.12345679)。
- タイトル・名前・ラベル・項目名が、日付や数値に変わることがあります(例:「001」→「1」、「1-2」→「1月2日」、「3/4」→「3月4日」、「(1)」→「-1」)。
- 「CSV(コンマ区切り)」で保存すると、日本語の文字コード(Shift-JIS)で表せない文字(「é」「—」「½」、絵文字など)が「?」に置き換わります。「CSV UTF-8(コンマ区切り)」で保存すると、そのまま残ります。
- 「=」「+」「-」「@」で始まるタイトル・名前は、CSVでは先頭に「'」を付けて書き出されます。CSVのまま保存し直したときは読み込みで外れますが、CSVをExcelで開いて.xlsxで保存すると「'」が残ります。
- Excelで日付になる入力:Excelでセルに「1/1」「1-2」のように入力すると、Excelが日付に変えます(年を省くと、入力した年になります)。グラフタイトル・変数名にこうしたセルがあると、Excelファイル(.xlsx)では「2026-01-01」の形(時刻があるときは「2026-01-01 12:30」)で、ExcelからCSVで保存したファイルでは、Excelの画面の表示のまま(「1月1日」など)で読み込まれます。入力したとおりの文字にしたいときは、先頭に「'」を付けて「'1/1」のように入力してください(「'」は読み込まれません)。数値のデータの欄に日付のセルがあると、行番号を示すエラーになります。
- To add data, enter X and Y together on the same row, directly below the last pair. A blank row in between, or a row with only X or only Y, causes an error. To delete data, delete the whole rows so that no gaps remain.
- Up to 10,000 pairs can be imported; more causes an error.
- The "Results" and "Chart" sheets (in CSV, the rows from "計算結果 / Results" down) are not used for importing. Edits there are not reflected; the results are recalculated from the input data after importing.
- Do not change item names or headings (such as "X変数名 / X Variable Name" or "Xデータ / X Data"). For what happens if you do, see "If you rename items" above.
- Notes on editing an exported file in Excel: we recommend opening the Excel export (.xlsx) and saving it as .xlsx again (values and names stay unchanged). If you open a CSV in Excel and save it again, Excel may rewrite its content. Files saved as either "CSV UTF-8 (Comma delimited)" or "CSV (Comma delimited)" can be imported, but they change as follows.
- Numbers are saved with the digits shown on screen (e.g. 10.123456789012344 → 10.12345679).
- Titles, names, labels, and item names may be turned into dates or numbers (e.g. "001" → "1", "1-2" → "1月2日" (Jan 2), "3/4" → "3月4日" (Mar 4), "(1)" → "-1").
- Saving as "CSV (Comma delimited)" replaces characters that cannot be represented in the Japanese encoding (Shift-JIS), such as "é", "—", "½", and emoji, with "?". Saving as "CSV UTF-8 (Comma delimited)" keeps them.
- A title or name starting with "=", "+", "-", or "@" is written in CSV with a leading "'". If you save the CSV again as CSV, the "'" is removed when importing; if you open the CSV in Excel and save it as .xlsx, the "'" stays.
- Entries that Excel turns into dates: when you type something like "1/1" or "1-2" into a cell, Excel changes it into a date (if you omit the year, the year when you typed it is used). If the chart title or variable names contain such a cell, it is imported in the form "2026-01-01" ("2026-01-01 12:30" if it has a time) from an Excel file (.xlsx), and as shown on the Excel screen (such as "1月1日") from a CSV saved in Excel. To keep exactly what you typed, put a "'" at the start, like "'1/1" (the "'" is not imported). A date cell in a numeric data column causes an error that shows the line number.
⑧ クリアボタン
⑧ Clear Buttons
- データだけクリア:X・Yデータ欄のみを空にします(変数名/タイトル/設定はそのまま)。
- 全体クリア:すべての入力内容をリセットします。
- Clear Data Only empties just the X/Y data fields (variable names, title, and settings are kept).
- Clear All resets every input.
⑨ データの取り扱いについて
⑨ Data Handling
入力・アップロードしたデータは、計算とグラフ作成のためにだけ処理され、サーバーに保存されません(通信はCloudflareを経由します。詳しくはプライバシーポリシーをご覧ください)。機密情報を含むデータは入力せず、品名・顧客名などは除くか記号に置き換えてご利用ください。
Data you enter or upload is processed only to perform calculations and create charts, and is not stored on the server (traffic passes through Cloudflare; see the Privacy Policy for details). Please do not enter confidential information; remove product or customer names or replace them with generic labels.