{"id":1749,"date":"2023-07-25T03:40:00","date_gmt":"2023-07-25T03:40:00","guid":{"rendered":"https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/"},"modified":"2023-07-25T03:40:00","modified_gmt":"2023-07-25T03:40:00","slug":"hoe-je-paarse-cp-in-r-berekent","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/","title":{"rendered":"Hoe paarse &#39;cp in r te berekenen"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Bij regressieanalyse is <a href=\"https:\/\/statorials.org\/nl\/paars-cp\/\" target=\"_blank\" rel=\"noopener\">Mallows Cp<\/a> een metriek die wordt gebruikt om het beste regressiemodel uit verschillende potenti\u00eble modellen te selecteren.<\/span><\/p>\n<p> <span style=\"color: #000000;\">We kunnen het \u2018beste\u2019 regressiemodel identificeren door het model te identificeren met de laagste Cp-waarde dichtbij <em>p<\/em> +1, waarbij <em>p<\/em> het aantal voorspellende variabelen in het model is.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De eenvoudigste manier om de Cp van Mallows in R te berekenen is door de functie <a href=\"https:\/\/www.rdocumentation.org\/packages\/olsrr\/versions\/0.5.3\/topics\/ols_mallows_cp\" target=\"_blank\" rel=\"noopener\">ols_mallows_cp()<\/a> uit het <strong>olsrr-<\/strong> pakket te gebruiken.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Het volgende voorbeeld laat zien hoe u deze functie kunt gebruiken om de Cp van Mallows te berekenen om het beste regressiemodel uit verschillende potenti\u00eble modellen in R te selecteren.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld: berekening van Mallows Cp in R<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Laten we zeggen dat we drie verschillende meervoudige lineaire regressiemodellen willen passen met behulp van variabelen uit de <strong>mtcars-<\/strong> dataset.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u de volgende regressiemodellen kunt aanpassen:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">Voorspellende variabelen in het volledige model: de 10 variabelen<\/span><\/li>\n<li> <span style=\"color: #000000;\">Voorspellervariabelen in model 1: disp, hp, wt, qsec<\/span><\/li>\n<li> <span style=\"color: #000000;\">Voorspellende variabelen in model 2: disp, qsec<\/span><\/li>\n<li> <span style=\"color: #000000;\">Voorspellende variabelen in model 3: disp, wt<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u elk van deze regressiemodellen kunt aanpassen en hoe u de functie <a href=\"https:\/\/www.rdocumentation.org\/packages\/olsrr\/versions\/0.5.3\/topics\/ols_mallows_cp\" target=\"_blank\" rel=\"noopener\">ols_mallows_cp()<\/a> kunt gebruiken om de Mallows Cp van elk model te berekenen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\">library<\/span> (olsrr)\n\n<span style=\"color: #008080;\">#fit full model\n<\/span>full_model &lt;- lm(mpg ~ ., data = mtcars)\n\n<span style=\"color: #008080;\">#fit three smaller models\n<\/span>model1 &lt;- lm(mpg ~ disp + hp + wt + qsec, data = mtcars)\nmodel2 &lt;- lm(mpg ~ disp + qsec, data = mtcars)\nmodel3 &lt;- lm(mpg ~ disp + wt, data = mtcars)\n\n<span style=\"color: #008080;\">#calculate Mallows' Cp for each model\n<\/span>ols_mallows_cp(model1, full_model)\n\n[1] 4.430434\n\nols_mallows_cp(model2, full_model)\n\n[1] 18.64082\n\nols_mallows_cp(model3, full_model)\n\n[1] 9.122225\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Zo interpreteert u het resultaat:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">Model 1: <em>p<\/em> + 1 = 5, Kaasjesjes Cp = 4,43<\/span><\/li>\n<li> <span style=\"color: #000000;\">Model 2: <em>p<\/em> + 1 = 3, Mallows Cp = 18,64<\/span><\/li>\n<li> <span style=\"color: #000000;\">Model 3: <em>p<\/em> + 1 = 30, Kaasjesjes Cp = 9,12<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">We kunnen zien dat model 1 een waarde voor Mallows&#8216; Cp heeft die het dichtst bij <em>p<\/em> + 1 ligt, wat aangeeft dat dit het beste model is dat tot de minste vertekening leidt onder de drie potenti\u00eble modellen.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Opmerkingen over de Cp des mauves<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Hier zijn enkele dingen waarmee u rekening moet houden bij Mallows Cp:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">Als elk potentieel model een hoge Mallows Cp-waarde heeft, geeft dit aan dat enkele belangrijke voorspellende variabelen waarschijnlijk in elk model ontbreken.<\/span><\/li>\n<li> <span style=\"color: #000000;\">Als meerdere potenti\u00eble modellen lage waarden hebben voor Mallow&#8217;s Cp, kies dan het model met de laagste waarde als het beste model om te gebruiken.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Houd er rekening mee dat de Cp van Mallows slechts \u00e9\u00e9n manier is om het &#8218;beste&#8216; regressiemodel uit verschillende potenti\u00eble modellen te identificeren.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Een andere veelgebruikte maatstaf is de aangepaste R-kwadraat, die ons vertelt hoeveel variantie in de<a href=\"https:\/\/statorials.org\/nl\/variabelen-verklarende-reacties\/\" target=\"_blank\" rel=\"noopener\">responsvariabele<\/a> kan worden verklaard door de voorspellende variabelen in het model, aangepast voor het aantal gebruikte voorspellende variabelen.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Om te beslissen welk regressiemodel het beste is uit een lijst van verschillende modellen, wordt aanbevolen om zowel naar Mallows&#8216; Cp als naar het aangepaste R-kwadraat te kijken.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\"><a href=\"https:\/\/statorials.org\/nl\/r-vierkanten-in-r-passen\/\" target=\"_blank\" rel=\"noopener\">Hoe u het aangepaste R-kwadraat in R kunt berekenen<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/aic-naar-r\/\" target=\"_blank\" rel=\"noopener\">Hoe AIC in R te berekenen<\/a><br \/><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bij regressieanalyse is Mallows Cp een metriek die wordt gebruikt om het beste regressiemodel uit verschillende potenti\u00eble modellen te selecteren. We kunnen het \u2018beste\u2019 regressiemodel identificeren door het model te identificeren met de laagste Cp-waarde dichtbij p +1, waarbij p het aantal voorspellende variabelen in het model is. De eenvoudigste manier om de Cp van [&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-1749","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 Mallows Cp in R te berekenen - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe je Mallows Cp in R kunt berekenen, met een stapsgewijs 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\/hoe-je-paarse-cp-in-r-berekent\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe Mallows Cp in R te berekenen - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe je Mallows Cp in R kunt berekenen, met een stapsgewijs voorbeeld.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-25T03:40:00+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\/hoe-je-paarse-cp-in-r-berekent\/\",\"url\":\"https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/\",\"name\":\"Hoe Mallows Cp in R te berekenen - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-25T03:40:00+00:00\",\"dateModified\":\"2023-07-25T03:40:00+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe je Mallows Cp in R kunt berekenen, met een stapsgewijs voorbeeld.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe paarse &#39;cp in r te berekenen\"}]},{\"@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 Mallows Cp in R te berekenen - Statorials","description":"In deze tutorial wordt uitgelegd hoe je Mallows Cp in R kunt berekenen, met een stapsgewijs 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\/hoe-je-paarse-cp-in-r-berekent\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe Mallows Cp in R te berekenen - Statorials","og_description":"In deze tutorial wordt uitgelegd hoe je Mallows Cp in R kunt berekenen, met een stapsgewijs voorbeeld.","og_url":"https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/","og_site_name":"Statorials","article_published_time":"2023-07-25T03:40:00+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\/hoe-je-paarse-cp-in-r-berekent\/","url":"https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/","name":"Hoe Mallows Cp in R te berekenen - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-25T03:40:00+00:00","dateModified":"2023-07-25T03:40:00+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe je Mallows Cp in R kunt berekenen, met een stapsgewijs voorbeeld.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/hoe-je-paarse-cp-in-r-berekent\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe paarse &#39;cp in r te berekenen"}]},{"@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\/1749","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=1749"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1749\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}