{"id":3788,"date":"2023-07-15T13:33:01","date_gmt":"2023-07-15T13:33:01","guid":{"rendered":"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/"},"modified":"2023-07-15T13:33:01","modified_gmt":"2023-07-15T13:33:01","slug":"multicollineariteit-in-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/","title":{"rendered":"Hoe te testen op multicollineariteit in r"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Bij regressieanalyse treedt <a href=\"https:\/\/statorials.org\/nl\/multicollineariteitsregressie\/\" target=\"_blank\" rel=\"noopener\">multicollineariteit<\/a> op wanneer twee of meer voorspellende variabelen sterk met elkaar gecorreleerd zijn, zodat ze geen unieke of onafhankelijke informatie verschaffen in het regressiemodel.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Als de mate van correlatie tussen de voorspellende variabelen hoog genoeg is, kan dit problemen veroorzaken bij het aanpassen en interpreteren van het regressiemodel.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De eenvoudigste manier om multicollineariteit in een regressiemodel te detecteren, is door een metriek te berekenen die bekend staat als de variantie-inflatiefactor, vaak afgekort als <strong>VIF<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">VIF meet de sterkte van de correlatie tussen voorspellende variabelen in een model. Er is een waarde tussen 1 en positief oneindig nodig.<\/span><\/p>\n<p> <span style=\"color: #000000;\">We gebruiken de volgende vuistregels om VIF-waarden te interpreteren:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>VIF = 1:<\/strong> Er is geen correlatie tussen een bepaalde voorspellende variabele en enige andere voorspellende variabele in het model.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>VIF tussen 1 en 5:<\/strong> Er is een matige correlatie tussen een bepaalde voorspellende variabele en andere voorspellende variabelen in het model.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>VIF &gt; 5<\/strong> : Er is een sterke correlatie tussen een bepaalde voorspellende variabele en andere voorspellende variabelen in het model.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Het volgende voorbeeld laat zien hoe u multicollineariteit in een regressiemodel in R kunt detecteren door VIF-waarden te berekenen voor elke voorspellende variabele in het model.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Voorbeeld: testen op multicollineariteit in R<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Stel dat we het volgende dataframe hebben met informatie over verschillende basketbalspelers:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create data frame\n<\/span>df = data. <span style=\"color: #3366ff;\">frame<\/span> (rating = c(90, 85, 82, 88, 94, 90, 76, 75, 87, 86),\n                points=c(25, 20, 14, 16, 27, 20, 12, 15, 14, 19),\n                assists=c(5, 7, 7, 8, 5, 7, 6, 9, 9, 5),\n                rebounds=c(11, 8, 10, 6, 6, 9, 6, 10, 10, 7))\n\n<span style=\"color: #008080;\">#view data frame\n<\/span>df\n\n   rating points assists rebounds\n1 90 25 5 11\n2 85 20 7 8\n3 82 14 7 10\n4 88 16 8 6\n5 94 27 5 6\n6 90 20 7 9\n7 76 12 6 6\n8 75 15 9 10\n9 87 14 9 10\n10 86 19 5 7\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Stel dat we een <a href=\"https:\/\/statorials.org\/nl\/meerdere-lineaire-regressie\/\" target=\"_blank\" rel=\"noopener\">meervoudig lineair regressiemodel<\/a> willen passen met behulp van <strong>scoring<\/strong> als de responsvariabele en <strong>points<\/strong> , <strong>assists<\/strong> en <strong>rebounds<\/strong> als de voorspellende variabelen.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Om de VIF voor elke voorspellende variabele in het model te berekenen, kunnen we de functie <strong>vive()<\/strong> uit het <b>car-<\/b> pakket gebruiken:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008000;\">library<\/span> (car)<\/span>\n\n#define multiple linear regression model\n<\/span>model &lt;- lm(rating ~ points + assists + rebounds, data=df)\n\n<span style=\"color: #008080;\">#calculate the VIF for each predictor variable in the model\n<\/span>lively(model)\n\n  points assists rebounds \n1.763977 1.959104 1.175030 \n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">We kunnen de VIF-waarden zien voor elk van de voorspellende variabelen:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>punten:<\/strong> 1,76<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>assists:<\/strong> 1.96<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>rebounds:<\/strong> 1.18<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Omdat elk van de VIF-waarden van de voorspellende variabelen in het model dichtbij 1 ligt, is multicollineariteit geen probleem in het model.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Opmerking<\/strong> : Als multicollineariteit een probleem blijkt te zijn in uw model, is de snelste oplossing in de meeste gevallen het verwijderen van een of meer sterk gecorreleerde variabelen.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Dit is vaak een acceptabele oplossing omdat de variabelen die u verwijdert sowieso overbodig zijn en weinig unieke of onafhankelijke informatie aan het model toevoegen.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">In de volgende tutorials wordt uitgelegd hoe u andere veelvoorkomende taken in R kunt uitvoeren:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/nl\/meervoudige-lineaire-regressie-r\/\" target=\"_blank\" rel=\"noopener\">Hoe meervoudige lineaire regressie uit te voeren in R<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/iemand-intrigeert-r\/\" target=\"_blank\" rel=\"noopener\">Hoe maak je een QQ-plot in R<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/restspoor-r\/\" target=\"_blank\" rel=\"noopener\">Hoe maak je een restplot in R<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bij regressieanalyse treedt multicollineariteit op wanneer twee of meer voorspellende variabelen sterk met elkaar gecorreleerd zijn, zodat ze geen unieke of onafhankelijke informatie verschaffen in het regressiemodel. Als de mate van correlatie tussen de voorspellende variabelen hoog genoeg is, kan dit problemen veroorzaken bij het aanpassen en interpreteren van het regressiemodel. De eenvoudigste manier om [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-3788","post","type-post","status-publish","format-standard","hentry","category-gids"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Hoe te testen op multicollineariteit in R - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u kunt testen op multicollineariteit in R, inclusief een volledig voorbeeld.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe te testen op multicollineariteit in R - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u kunt testen op multicollineariteit in R, inclusief een volledig voorbeeld.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-15T13:33:01+00:00\" \/>\n<meta name=\"author\" content=\"Dr.benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/\",\"url\":\"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/\",\"name\":\"Hoe te testen op multicollineariteit in R - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-15T13:33:01+00:00\",\"dateModified\":\"2023-07-15T13:33:01+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u kunt testen op multicollineariteit in R, inclusief een volledig voorbeeld.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe te testen op multicollineariteit in r\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/nl\/#website\",\"url\":\"https:\/\/statorials.org\/nl\/\",\"name\":\"Statorials\",\"description\":\"Uw gids voor statistische competentie\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/nl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder\",\"sameAs\":[\"http:\/\/statorials.org\/nl\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hoe te testen op multicollineariteit in R - Statorials","description":"In deze tutorial wordt uitgelegd hoe u kunt testen op multicollineariteit in R, inclusief een volledig voorbeeld.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe te testen op multicollineariteit in R - Statorials","og_description":"In deze tutorial wordt uitgelegd hoe u kunt testen op multicollineariteit in R, inclusief een volledig voorbeeld.","og_url":"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/","og_site_name":"Statorials","article_published_time":"2023-07-15T13:33:01+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"2\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/","url":"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/","name":"Hoe te testen op multicollineariteit in R - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-15T13:33:01+00:00","dateModified":"2023-07-15T13:33:01+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u kunt testen op multicollineariteit in R, inclusief een volledig voorbeeld.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/multicollineariteit-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe te testen op multicollineariteit in r"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/nl\/#website","url":"https:\/\/statorials.org\/nl\/","name":"Statorials","description":"Uw gids voor statistische competentie","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/nl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de"},{"@type":"Person","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder","sameAs":["http:\/\/statorials.org\/nl"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/3788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/comments?post=3788"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/3788\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=3788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=3788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=3788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}