R Programming for beginners | Correlation Matrix in R using Cor package

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024
  • How to use Cor function in R Studio.
    How to draw correlation matrix using Pearson, Kendell and Spearman methods.
    How to draw different shapes of correlation matrix.

ความคิดเห็น • 57

  • @demigod4504
    @demigod4504 8 หลายเดือนก่อน +2

    Thanks for the video Sir. I have to use a colorRampPalette to see colors on the plot.
    corrplot (Time, method = "color", col = colorRampPalette(c("blue", "white", "red"))(200),
    type = "upper", order = "hclust", addCoef.col = "black",
    tl.col = "black", tl.srt = 45, diag = FALSE)

  • @muhammadkhubaib5666
    @muhammadkhubaib5666 3 ปีที่แล้ว +1

    excellent work I tried your code and it works, eager for more videos from your side....

  • @Auni03
    @Auni03 2 ปีที่แล้ว +2

    it was really a great help thank you so much for giving very simple and precise details.

    • @Tota-tj5oh
      @Tota-tj5oh 2 ปีที่แล้ว

      I don’t work with my data?

  • @Mann-253
    @Mann-253 14 วันที่ผ่านมา

    Hlo sir, i have query regarding the last script. What is the meaning of col (200) and on what basis i have fill this number in col and similar problem in tl.srt = 45 .. what does it mean

  • @waqarazeemjadoon
    @waqarazeemjadoon ปีที่แล้ว +1

    Thank you very much, I am a big fan of R and wanted to use it for quite long. Your this video made things very easy. However, it would be so nice of you, if you let me know how to highlight significant values in correlation and the confidence level (eg 99.99% or 95%). Secondly, do you have any video on PCA/FA and Cluster Analysis in R using water quality data?

    • @softwaresforcivilengineeri7947
      @softwaresforcivilengineeri7947  ปีที่แล้ว +1

      Thank you, Just update the values portion, please send me the your code, and query, i will update them for you.

    • @waqarazeemjadoon
      @waqarazeemjadoon ปีที่แล้ว

      @@softwaresforcivilengineeri7947
      I am using the code you developed, however, I just want to add the significant values or star on in final diagram. The code is given below.
      > corrplot(m, method=“color”, col = col(200), type = “upper”, order= “hclust”, addCoef.col = “black”, tl.col = “black”, tl.srt = 45, diag = FALSE)

    • @waqarazeemjadoon
      @waqarazeemjadoon ปีที่แล้ว

      @@softwaresforcivilengineeri7947 similarly, used your code for box wicker plots and it worked well. However, can you help to show the box plots using logarithmic y axis. Because in my case some of values are too small and some other too large and box plots with small cant be seen properly. The log scale can solve this issue

  • @hope2024-g
    @hope2024-g 2 ปีที่แล้ว +1

    Thank you Sir for your nice tutorial. How can I put asterisk (***) in the method argument instead of number please?

  • @girijaprasadpatnaik2113
    @girijaprasadpatnaik2113 2 ปีที่แล้ว

    Great help sir !

  • @rwaewae
    @rwaewae 2 ปีที่แล้ว +1

    how can we combine summary of statistics and correlation plot in one diagram. thanx

  • @geovenkat
    @geovenkat 8 หลายเดือนก่อน

    nice video very useful but i got this following error how to solve corrplot(m,method = "color",col(200),type = "upper", order = "hclust", addCoef.col = "black", tl.col = "black", tl.srt = 45, diag = FALSE)
    Error in col(200) : a matrix-like object is required as argument to 'col'

  • @souravdebnath8551
    @souravdebnath8551 3 ปีที่แล้ว

    Nice one thanks

  • @bolormaatsedenish6123
    @bolormaatsedenish6123 6 หลายเดือนก่อน

    thank you

  • @karmatempa133
    @karmatempa133 3 ปีที่แล้ว +1

    I am facing attach error. When I type attach(correlation_matrix), correlation_matrix is not listed in drop down list. Kindly help.

    • @softwaresforcivilengineeri7947
      @softwaresforcivilengineeri7947  3 ปีที่แล้ว

      correlation_matrix is basically my data name. if you have the data in excel format. just upload it to R in the same manner. and you can give it the name correlation matrix.

  • @andreifrancojimenez7714
    @andreifrancojimenez7714 ปีที่แล้ว

    Thanks!

  • @endrishussen5495
    @endrishussen5495 ปีที่แล้ว +1

    Aselamua'leyikum werahmetulah, I ahve sort of data would you help me by analysing the correlation between variables by using R software

  • @karmatempa133
    @karmatempa133 3 ปีที่แล้ว +1

    Sir,
    Kindly help me solve following issue:
    Error in attach(correlation_matrix) :
    object 'correlation_matrix' not found
    Thanks in advance!!

    • @softwaresforcivilengineeri7947
      @softwaresforcivilengineeri7947  3 ปีที่แล้ว

      correlation_matrix is basically my data name. if you have the data in excel format. just upload it to R in the same manner. and you can give it the name correlation matrix.

    • @karmatempa133
      @karmatempa133 3 ปีที่แล้ว

      @@softwaresforcivilengineeri7947 Thank You.

    • @girijaprasadpatnaik2113
      @girijaprasadpatnaik2113 2 ปีที่แล้ว

      Thank you for the question and answer ❣️

  • @dr.mohdaamir6688
    @dr.mohdaamir6688 ปีที่แล้ว

    Can u please make a videos on Gene expression Analysis using R packages from base to advance ??

  • @doubanstella457
    @doubanstella457 ปีที่แล้ว

    I found this error , can you help ? "Error in corrplot::corrplot(HVI_Indicators_2021, method = "number") :
    The matrix is not in [-1, 1]!"

  • @daveandrew
    @daveandrew ปีที่แล้ว

    Nice. I successfully create the circle, number, and pie. But, the last one the upper triangle; it did not work by showing : Error in col(200) : a matrix-like object is required as argument to 'col'. Kindly help

    • @daveandrew
      @daveandrew ปีที่แล้ว

      Can you send or copy here the comment/script for the upper triangle one please

    • @softwaresforcivilengineeri7947
      @softwaresforcivilengineeri7947  ปีที่แล้ว

      @@daveandrew Thank you for your comments, first please save the col(200) type with a unique variable e.g "colour=col(200) and then run the above code. Also install the concerned packages used for colors.

    • @daveandrew
      @daveandrew ปีที่แล้ว

      @@softwaresforcivilengineeri7947 thank you. Do you have a video to create circular plot in R?

  • @share4care604
    @share4care604 3 ปีที่แล้ว

    Sir
    Please tell me in which condition we use Pearson, spearman,and Kendall correlation?

    • @softwaresforcivilengineeri7947
      @softwaresforcivilengineeri7947  3 ปีที่แล้ว

      when you do not mention the type of correlation to R. it will take Pearson correlation by default. But if you want to draw another type of correlation, then you need to mention that type. the only difference is in the formula. if you want the detail I will share them with you.

    • @Darkossamael
      @Darkossamael 3 ปีที่แล้ว

      When should you use Pearson, Spearman or other?

    • @cintiacristinadacostafreir7694
      @cintiacristinadacostafreir7694 ปีที่แล้ว

      @@softwaresforcivilengineeri7947 Hi!! I want to draw Spearman correlation, how do i do this mention in R?

    • @softwaresforcivilengineeri7947
      @softwaresforcivilengineeri7947  ปีที่แล้ว

      @@cintiacristinadacostafreir7694 just type spearman instead of Pearson.

  • @jasminstariolo1514
    @jasminstariolo1514 2 ปีที่แล้ว

    Sir, first of all I'd like to thank you for this correlation matrix video. It has been really usefull.
    Please help me with the following error:
    > cor(dados, method = "spearman") #"dados" is my data name
    Error in cor(dados, method = "spearman") : 'x' must be numeric

    • @softwaresforcivilengineeri7947
      @softwaresforcivilengineeri7947  2 ปีที่แล้ว

      Please arrange your data. i think your data have some non numeric values. All the rows and columns of the data must be numeric. if then you face the problem please share your data.

  • @amirrezafotovvat3051
    @amirrezafotovvat3051 2 ปีที่แล้ว

    Hello. Thanks for your great video. When I tried the code for upper matrix type, I got this error: Error in col(200) : a matrix-like object is required as argument to 'col'
    Would you please help me figure out the reason?

    • @softwaresforcivilengineeri7947
      @softwaresforcivilengineeri7947  2 ปีที่แล้ว

      col(200) needed another package to install. just remove this col(200). or install package for colors in R.

    • @girijaprasadpatnaik2113
      @girijaprasadpatnaik2113 2 ปีที่แล้ว

      Kindly tell how to install package for colors in R

    • @girijaprasadpatnaik2113
      @girijaprasadpatnaik2113 2 ปีที่แล้ว

      Even after deleting Col(200) some error is showing kindly help to get through it

  • @dr.muhammadnaveed4136
    @dr.muhammadnaveed4136 3 ปีที่แล้ว

    Good

  • @kamalbenali1260
    @kamalbenali1260 2 ปีที่แล้ว

    Could not find function corrplot?

  • @aarizahmed4514
    @aarizahmed4514 3 ปีที่แล้ว

    Please share video on lag1 auto-corellation

  • @sudhirKumar-ru3tu
    @sudhirKumar-ru3tu 3 ปีที่แล้ว

    Please share the R code... such demo are of no use if you really teach

    • @softwaresforcivilengineeri7947
      @softwaresforcivilengineeri7947  3 ปีที่แล้ว +2

      Dear if you see the video, the R code is there.. But if you want the same code.. From now i will share the code also

    • @rajendraa
      @rajendraa 3 ปีที่แล้ว +1

      @@softwaresforcivilengineeri7947 we are seeing your video and keeping seeing

  • @gishue975
    @gishue975 3 ปีที่แล้ว

    Sir, I have Error in col = col(200), please help me?

    • @softwaresforcivilengineeri7947
      @softwaresforcivilengineeri7947  3 ปีที่แล้ว

      I know this causes some time an error..just erase this one..col=col(200) .and run the remaining code

    • @softwaresforcivilengineeri7947
      @softwaresforcivilengineeri7947  3 ปีที่แล้ว

      If not run then tell me..I will correct it

    • @gishue975
      @gishue975 3 ปีที่แล้ว +1

      @@softwaresforcivilengineeri7947 erase is Ok, bro. But the chart is not good