{"id":3174,"date":"2015-07-21T14:08:34","date_gmt":"2015-07-21T13:08:34","guid":{"rendered":"https:\/\/abcdr.guyader.pro\/?p=3174"},"modified":"2018-04-08T00:02:17","modified_gmt":"2018-04-07T23:02:17","slug":"comment-mesurer-le-coefficient-de-correlation-entre-deux-variables-cor-test","status":"publish","type":"post","link":"https:\/\/thinkr.fr\/abcdr\/comment-mesurer-le-coefficient-de-correlation-entre-deux-variables-cor-test\/","title":{"rendered":"Comment tester la significativit\u00e9 du coefficient de corr\u00e9lation associ\u00e9 \u00e0 deux variables ? cor.test"},"content":{"rendered":"<p>Le coefficient de corr\u00e9lation, mesur\u00e9 par la fonction <strong>cor()<\/strong>, permet de savoir \u00e0 quel point deux variables quantitatives sont corr\u00e9l\u00e9es. Il existe 3 m\u00e9thodes pour tester la significativit\u00e9 de ce coefficient\u00a0: la m\u00e9thode de \u00ab\u00a0Pearson\u00a0\u00bb, de \u00ab\u00a0Kendall\u00a0\u00bb, et de \u00ab\u00a0Spearman\u00a0\u00bb.<\/p>\n<p>\u00a0<\/p>\n<p>Pour r\u00e9aliser ce test il est n\u00e9cessaire d\u2019avoir un \u00e9chantillonnage al\u00e9atoire et qu\u2019il n\u2019y ait pas de donn\u00e9es manquantes. Si les deux variables suivent une loi Normale et que leur relation est suppos\u00e9e lin\u00e9aire on utilise la m\u00e9thode de \u00ab\u00a0Pearson\u00a0\u00bb. Si la relation entre les deux variables est suppos\u00e9e monotone on utilise la m\u00e9thode de \u00ab\u00a0Kendall\u00a0\u00bb ou de \u00ab\u00a0Spearman\u00a0\u00bb.<\/p>\n<p>Nous utilisons les fonctions suivantes\u00a0:<\/p>\n<p>Soit x la premi\u00e8re variable et y la deuxi\u00e8me variable.<\/p>\n<p>\u00a0<\/p>\n<p>Pour la m\u00e9thode de \u00ab\u00a0Pearson\u00a0\u00bb, <b>cor.test(x,y,method=\u00a0\u00ab\u00a0pearson\u00a0\u00bb)<\/b><\/p>\n<p>Pour la m\u00e9thode de \u00ab\u00a0Kendall\u00a0\u00bb, <b>cor.test(x,y,method=\u00a0\u00ab\u00a0kendall\u00a0\u00bb)<\/b><\/p>\n<p>Pour la m\u00e9thode de \u00ab\u00a0Spearman\u00a0\u00bb, <b>cor.test(x,y,method=\u00a0\u00ab\u00a0spearm\u00a0\u00bb)<\/b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <b><\/b><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p>Exemple\u00a0:<\/p>\n<pre><code>\n\nx &lt;- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1)\n\ny &lt;- c( 2.6,\u00a0 3.1,\u00a0 2.5,\u00a0 5.0,\u00a0 3.6,\u00a0 4.0,\u00a0 5.2,\u00a0 2.8,\u00a0 3.8)\n\n\u00a0\n\ncor.test(x, y, method = \"kendall\")\n\n#\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Kendall's rank correlation tau\n\n\u00a0\n\n#data:\u00a0 x and y\n\n#T = 26, p-value = 0.1194\n\n#alternative hypothesis: true tau is not equal to 0\n\n#sample estimates:\n\n#\u00a0\u00a0\u00a0\u00a0\u00a0 tau\n\n#0.4444444\n\n# tau est le coefficient de corr\u00e9lation de Kendall\n\n\u00a0\n\n\u00a0\n\n\u00a0\n\ncor.test(x, y, method = \"spearm\")\n\n#\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Spearman's rank correlation rho\n\n\u00a0\n\n#data:\u00a0 x and y\n\n#S = 48, p-value = 0.0968\n\n#alternative hypothesis: true rho is not equal to 0\n\n#sample estimates:\n\n#rho\n\n#0.6\n\n# rho est le coefficient de corr\u00e9lation de Spearman\n\n\u00a0\n\n\u00a0\n\ncor.test(x, y, method = \"pearson\")\n\n#\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Pearson's product-moment correlation\n\n\u00a0\n\n#data:\u00a0 x and y\n\n#t = 1.8411, df = 7, p-value = 0.1082\n\n#alternative hypothesis: true correlation is not equal to 0\n\n#95 percent confidence interval:\n\n#\u00a0-0.1497426\u00a0 0.8955795\n\n#sample estimates:\n\n#\u00a0\u00a0\u00a0\u00a0\u00a0 cor\n\n#0.5711816\n\n# cor est le coefficient de corr\u00e9lation de Pearson\n\n<\/code><\/pre>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Le coefficient de corr\u00e9lation, mesur\u00e9 par la fonction cor(), permet de savoir \u00e0 quel point deux variables quantitatives sont corr\u00e9l\u00e9es. Il existe 3 m\u00e9thodes pour tester la significativit\u00e9 de ce coefficient\u00a0: la m\u00e9thode de \u00ab\u00a0Pearson\u00a0\u00bb, de \u00ab\u00a0Kendall\u00a0\u00bb, et de \u00ab\u00a0Spearman\u00a0\u00bb. \u00a0 Pour r\u00e9aliser ce test il est n\u00e9cessaire d\u2019avoir un \u00e9chantillonnage al\u00e9atoire et qu\u2019il n\u2019y ait pas de donn\u00e9es manquantes. Si les deux variables suivent une loi Normale et que leur relation est suppos\u00e9e lin\u00e9aire on utilise la m\u00e9thode de \u00ab\u00a0Pearson\u00a0\u00bb. Si la relation entre les deux variables est suppos\u00e9e monotone on utilise la m\u00e9thode de \u00ab\u00a0Kendall\u00a0\u00bb ou de \u00ab\u00a0Spearman\u00a0\u00bb. Nous utilisons les fonctions suivantes\u00a0:<a class=\"more-link\" href=\"https:\/\/thinkr.fr\/abcdr\/comment-mesurer-le-coefficient-de-correlation-entre-deux-variables-cor-test\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","rop_custom_images_group":[],"rop_custom_messages_group":[],"rop_publish_now":"initial","rop_publish_now_accounts":{"twitter_399453572_399453572":""},"rop_publish_now_history":[],"rop_publish_now_status":"pending","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[21],"tags":[],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-helene","4":"post-3174","6":"format-standard","7":"category-test"},"acf":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p9O7Sx-Pc","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/posts\/3174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/comments?post=3174"}],"version-history":[{"count":2,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/posts\/3174\/revisions"}],"predecessor-version":[{"id":4292,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/posts\/3174\/revisions\/4292"}],"wp:attachment":[{"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/media?parent=3174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/categories?post=3174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/tags?post=3174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}