フィルターのクリア

How can get a correlation plot?

90 ビュー (過去 30 日間)
Roja Eliza
Roja Eliza 2023 年 9 月 25 日
コメント済み: Roja Eliza 2023 年 9 月 26 日
How do I create this kind of correlation plot using corrplot function. Suppose I have 8 variables with multiple valueses in an excel table sheet. Also how can i get the r2 values with *marks along the sides of r2 values showing the relationship is significant or not.
  4 件のコメント
the cyclist
the cyclist 2023 年 9 月 26 日
編集済み: the cyclist 2023 年 9 月 26 日
Can you upload the data? (You can use the paper clip icon in the INSERT section of the toolbar.)
Either upload y itself in a MAT file, or upload your Excel file and the code that takes you from Excel to y. (Doing the latter is probably better, because maybe that is where something you are doing is going wrong.)
Roja Eliza
Roja Eliza 2023 年 9 月 26 日
I figured it out actually. I had to write the data matrix completely in the script then use the corrplot function to make it work. But thanks for the suggestion I ll try your way too to make the code more simple and easy.

サインインしてコメントする。

回答 (1 件)

the cyclist
the cyclist 2023 年 9 月 25 日
Here is one plan of action:
  • Use the readtable function to load your data into MATLAB
  • Use corrplot to get the plot
  • Use the corr function to obtain the P values for the correlations
  • Use text or annotation to add a symbol next to the significant values
  1 件のコメント
Roja Eliza
Roja Eliza 2023 年 9 月 26 日
Thank you. I have already and exactly tried what you have suggested. Also as I can see from the example given from the corrplot help section in matlab that it should automatically give the r2 values. I keep getting these error message " Format of table or timetable X is invalid, or it contains invalid data. Tables cannot be nested inside other tables or timetables, relevant variables must contain numeric data, and related variables must contain the same number of paths."

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by