{"id":2138,"date":"2023-07-23T13:06:58","date_gmt":"2023-07-23T13:06:58","guid":{"rendered":"https:\/\/statorials.org\/nl\/bic-tot-r\/"},"modified":"2023-07-23T13:06:58","modified_gmt":"2023-07-23T13:06:58","slug":"bic-tot-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/bic-tot-r\/","title":{"rendered":"Hoe bic in r te berekenen"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Het <strong>Bayesiaanse informatiecriterium<\/strong> , vaak afgekort <strong>BIC<\/strong> , is een maatstaf die wordt gebruikt om de goodness of fit van verschillende regressiemodellen te vergelijken.<\/span><\/p>\n<p> <span style=\"color: #000000;\">In de praktijk passen we meerdere regressiemodellen aan dezelfde dataset toe en kiezen we het model met de laagste BIC-waarde als het model dat het beste bij de data past.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Voor het berekenen van de BIC gebruiken wij de volgende formule:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>BIC:<\/strong> (RSS+log(n)d\u03c3\u0302 <sup>2<\/sup> ) \/ n<\/span><\/p>\n<p> <span style=\"color: #000000;\">Goud:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>d:<\/strong> Het aantal voorspellers<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>n:<\/strong> Totaal aantal waarnemingen<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>\u03c3\u0302:<\/strong> schatting van de foutvariantie die is gekoppeld aan elke responsmaatstaf in een regressiemodel<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>RSS:<\/strong> Residuele som van kwadraten uit het regressiemodel<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>TSS:<\/strong> Totale som van kwadraten van het regressiemodel<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Het volgende stapsgewijze voorbeeld laat zien hoe u BIC-waarden voor regressiemodellen in R kunt berekenen.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Stap 1: Gegevens bekijken<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Voor dit voorbeeld gebruiken we de ingebouwde <strong>mtcars<\/strong> -dataset:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#view first six rows of mtcars dataset\n<span style=\"color: #000000;\">head(mtcars)<\/span>\n<\/span>mpg cyl disp hp drat wt qsec vs am gear carb\nMazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4\nMazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4\nDatsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1\nHornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1\nHornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2\nValiant 18.1 6 225 105 2.76 3,460 20.22 1 0 3 1\n<\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>Stap 2: installeer meerdere sjablonen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Vervolgens zullen we verschillende regressiemodellen passen met behulp van deze dataset:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#fit three different regression models\n<span style=\"color: #000000;\">model1 &lt;- lm(mpg ~ disp + hp, data = mtcars)<\/span>\n<span style=\"color: #000000;\">model2 &lt;- lm(mpg ~ disp + qsec, data = mtcars)<\/span>\n<span style=\"color: #000000;\">model3 &lt;- lm(mpg ~ disp + wt, data = mtcars)<\/span>\n<\/span><\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>Stap 3: Kies het model met de laagste BIC<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Om de BIC-waarde voor elk model te berekenen, kunnen we de <strong>BIC()-<\/strong> functie uit het <strong>flexmix-<\/strong> 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: #ff0000;\">library<\/span> (flexmix)\n\n<span style=\"color: #008080;\">#calculate BIC of model1\n<\/span>BIC(model1)\n\n[1] 174.4815\n\n<span style=\"color: #008080;\">#calculate BIC of model2\n<\/span>BIC(model2)\n\n[1] 177.7048\n\n<span style=\"color: #008080;\">#calculate BIC of model3\n<\/span>BIC(model3)\n\n[1] 170.0307\n<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">We kunnen de BIC-waarden voor elk model zien:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">BIC van <strong>model 1<\/strong> : 174.4815<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>Model 2<\/strong> BIC: 177.7048<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>Model 3<\/strong> BIC: 170.0307<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Omdat model 3 de laagste BIC-waarde heeft, zullen we dit kiezen als het model dat het beste bij de dataset past.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">In de volgende tutorials wordt uitgelegd hoe u algemene regressiemodellen in R kunt passen:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/nl\/eenvoudige-lineaire-regressie-in-r\/\" target=\"_blank\" rel=\"noopener\">Hoe eenvoudige lineaire regressie uit te voeren in R<\/a><br \/> <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 \/> Hoe logistische regressie uit te voeren in R<br \/><a href=\"https:\/\/statorials.org\/nl\/gewogen-kleinste-kwadraten-in-r\/\" target=\"_blank\" rel=\"noopener\">Hoe u een gewogen kleinste kwadratenregressie uitvoert in R<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Het Bayesiaanse informatiecriterium , vaak afgekort BIC , is een maatstaf die wordt gebruikt om de goodness of fit van verschillende regressiemodellen te vergelijken. In de praktijk passen we meerdere regressiemodellen aan dezelfde dataset toe en kiezen we het model met de laagste BIC-waarde als het model dat het beste bij de data past. Voor [&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-2138","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 BIC te berekenen in R - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u BIC-waarden voor regressiemodellen in R kunt berekenen, met voorbeelden.\" \/>\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\/bic-tot-r\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe BIC te berekenen in R - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u BIC-waarden voor regressiemodellen in R kunt berekenen, met voorbeelden.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/bic-tot-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-23T13:06:58+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\/bic-tot-r\/\",\"url\":\"https:\/\/statorials.org\/nl\/bic-tot-r\/\",\"name\":\"Hoe BIC te berekenen in R - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-23T13:06:58+00:00\",\"dateModified\":\"2023-07-23T13:06:58+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u BIC-waarden voor regressiemodellen in R kunt berekenen, met voorbeelden.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/bic-tot-r\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/bic-tot-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/bic-tot-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe bic 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 BIC te berekenen in R - Statorials","description":"In deze tutorial wordt uitgelegd hoe u BIC-waarden voor regressiemodellen in R kunt berekenen, met voorbeelden.","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\/bic-tot-r\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe BIC te berekenen in R - Statorials","og_description":"In deze tutorial wordt uitgelegd hoe u BIC-waarden voor regressiemodellen in R kunt berekenen, met voorbeelden.","og_url":"https:\/\/statorials.org\/nl\/bic-tot-r\/","og_site_name":"Statorials","article_published_time":"2023-07-23T13:06:58+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\/bic-tot-r\/","url":"https:\/\/statorials.org\/nl\/bic-tot-r\/","name":"Hoe BIC te berekenen in R - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-23T13:06:58+00:00","dateModified":"2023-07-23T13:06:58+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u BIC-waarden voor regressiemodellen in R kunt berekenen, met voorbeelden.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/bic-tot-r\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/bic-tot-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/bic-tot-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe bic 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\/2138","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=2138"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/2138\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=2138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=2138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=2138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}