{"id":1750,"date":"2023-07-25T03:37:36","date_gmt":"2023-07-25T03:37:36","guid":{"rendered":"https:\/\/statorials.org\/nl\/aic-naar-r\/"},"modified":"2023-07-25T03:37:36","modified_gmt":"2023-07-25T03:37:36","slug":"aic-naar-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/aic-naar-r\/","title":{"rendered":"Hoe aic in r te berekenen (inclusief voorbeelden)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Het Akaike Information Criterion (AIC) is een maatstaf die wordt gebruikt om de fit van meerdere regressiemodellen te vergelijken.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Het wordt als volgt berekend:<\/span><\/p>\n<p> <span style=\"color: #000000;\">AIC = 2K \u2013 2 <em>ln<\/em> (L)<\/span><\/p>\n<p> <span style=\"color: #000000;\">Goud:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>K:<\/strong> Het aantal modelparameters. De standaardwaarde van K is 2, dus een model met slechts \u00e9\u00e9n voorspellende variabele heeft een K-waarde van 2+1 = 3.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong><em>ln<\/em> (L)<\/strong> : De log-waarschijnlijkheid van het model. De meeste statistische software kan deze waarde automatisch voor u berekenen.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">AIC is ontworpen om het model te vinden dat de meeste variatie in de gegevens verklaart, terwijl modellen worden bestraft die een buitensporig aantal parameters gebruiken.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Nadat u meerdere regressiemodellen heeft ge\u00efnstalleerd, kunt u<\/span> <span style=\"color: #000000;\">de AIC-waarde van elk model vergelijken. Hoe lager de AIC, hoe geschikter het model.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Om de AIC van meerdere regressiemodellen in R te berekenen, kunnen we de functie <strong>aictab()<\/strong> uit het <strong>AICcmodavg-<\/strong> pakket gebruiken.<\/span><\/p>\n<p> <span style=\"color: #000000;\">In het volgende voorbeeld ziet u hoe u deze functie kunt gebruiken om de AIC voor verschillende regressiemodellen in R te berekenen en te interpreteren.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld: bereken en interpreteer AIC in R<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Laten we zeggen dat we drie verschillende <a href=\"https:\/\/statorials.org\/nl\/meerdere-lineaire-regressie\/\" target=\"_blank\" rel=\"noopener\">meervoudige lineaire regressiemodellen<\/a> willen passen met behulp van variabelen uit de <strong>mtcars-<\/strong> dataset.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Dit zijn de voorspellende variabelen die we in elk model zullen gebruiken:<\/span><\/p>\n<ul>\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 elk van deze regressiemodellen past:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#fit three 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<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Vervolgens plaatsen we de modellen in een lijst en gebruiken we de functie <strong>aictab()<\/strong> om de AIC van elk model te berekenen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #993300;\">library<\/span> (AICcmodavg)<\/span>\n\n#define list of models\n<\/span>models &lt;- list(model1, model2, model3)\n\n<span style=\"color: #008080;\">#specify model names\n<\/span>mod.names &lt;- c('disp.hp.wt.qsec', 'disp.qsec', 'disp.wt')\n\n<span style=\"color: #008080;\">#calculate AIC of each model\n<\/span>aictab(cand.set = models, modnames = mod.names)\n\nModel selection based on AICc:\n\n                K AICc Delta_AICc AICcWt Cum.Wt LL\ndisp.hp.wt.qsec 6 162.43 0.00 0.83 0.83 -73.53\navailable wt 4 165.65 3.22 0.17 1.00 -78.08\ndisp.qsec 4 173.32 10.89 0.00 1.00 -81.92\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Zo interpreteert u het resultaat:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><b>K:<\/b> Het aantal parameters in het model.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>AICc:<\/strong> de AIC-waarde van het model. De kleine letter \u201cc\u201d geeft aan dat de AIC is berekend op basis van de AIC, gecorrigeerd voor kleine monsters.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>Delta_AICc:<\/strong> het verschil tussen de AIC van het beste model en die van het huidige vergeleken model.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>AICcWt:<\/strong> aandeel van de totale voorspellende kracht die in het model kan worden gevonden.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>Cum.Wt<\/strong> : De cumulatieve som van de AIC-gewichten.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><span style=\"color: #000000;\"><b>LL:<\/b> De logwaarschijnlijkheid van het model. Dit vertelt ons hoe waarschijnlijk het model is, gegeven de gegevens die we hebben gebruikt.<\/span><\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Het model met de laagste AIC-waarde wordt altijd als eerste vermeld. Uit het resultaat kunnen we zien dat het volgende model de laagste AIC-waarde heeft en daarom het best passende model is:<\/span><\/p>\n<p> <span style=\"color: #000000;\">mpg = \u03b2 <sub>0<\/sub> + \u03b2 <sub>1<\/sub> (disp) + \u03b2 <sub>2<\/sub> (pk) + \u03b2 <sub>3<\/sub> (gewicht) + \u03b2 <sub>4<\/sub> (qsec)<\/span><\/p>\n<p> <span style=\"color: #000000;\">Zodra we dit model als het beste hebben ge\u00efdentificeerd, kunnen we doorgaan met het aanpassen van het model en de resultaten analyseren, inclusief de R-kwadraatwaarde en b\u00e8taco\u00ebffici\u00ebnten, om de exacte relatie tussen de reeks voorspellende variabelen en de<a href=\"https:\/\/statorials.org\/nl\/variabelen-verklarende-reacties\/\" target=\"_blank\" rel=\"noopener\">responsvariabele<\/a> te bepalen.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h3>\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 \/> <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\/hoe-je-paarse-cp-in-r-berekent\/\" target=\"_blank\" rel=\"noopener\">Hoe Mallows Cp in R te berekenen<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Het Akaike Information Criterion (AIC) is een maatstaf die wordt gebruikt om de fit van meerdere regressiemodellen te vergelijken. Het wordt als volgt berekend: AIC = 2K \u2013 2 ln (L) Goud: K: Het aantal modelparameters. De standaardwaarde van K is 2, dus een model met slechts \u00e9\u00e9n voorspellende variabele heeft een K-waarde van 2+1 [&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-1750","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 AIC in R te berekenen (inclusief voorbeelden) - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt met voorbeelden uitgelegd hoe u het Akaike Information Criterion (AIC) voor een regressiemodel in R kunt berekenen.\" \/>\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\/aic-naar-r\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe AIC in R te berekenen (inclusief voorbeelden) - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt met voorbeelden uitgelegd hoe u het Akaike Information Criterion (AIC) voor een regressiemodel in R kunt berekenen.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/aic-naar-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-25T03:37:36+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=\"3\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/aic-naar-r\/\",\"url\":\"https:\/\/statorials.org\/nl\/aic-naar-r\/\",\"name\":\"Hoe AIC in R te berekenen (inclusief voorbeelden) - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-25T03:37:36+00:00\",\"dateModified\":\"2023-07-25T03:37:36+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt met voorbeelden uitgelegd hoe u het Akaike Information Criterion (AIC) voor een regressiemodel in R kunt berekenen.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/aic-naar-r\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/aic-naar-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/aic-naar-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe aic in r te berekenen (inclusief voorbeelden)\"}]},{\"@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 AIC in R te berekenen (inclusief voorbeelden) - Statorials","description":"In deze tutorial wordt met voorbeelden uitgelegd hoe u het Akaike Information Criterion (AIC) voor een regressiemodel in R kunt berekenen.","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\/aic-naar-r\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe AIC in R te berekenen (inclusief voorbeelden) - Statorials","og_description":"In deze tutorial wordt met voorbeelden uitgelegd hoe u het Akaike Information Criterion (AIC) voor een regressiemodel in R kunt berekenen.","og_url":"https:\/\/statorials.org\/nl\/aic-naar-r\/","og_site_name":"Statorials","article_published_time":"2023-07-25T03:37:36+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"3\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/aic-naar-r\/","url":"https:\/\/statorials.org\/nl\/aic-naar-r\/","name":"Hoe AIC in R te berekenen (inclusief voorbeelden) - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-25T03:37:36+00:00","dateModified":"2023-07-25T03:37:36+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt met voorbeelden uitgelegd hoe u het Akaike Information Criterion (AIC) voor een regressiemodel in R kunt berekenen.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/aic-naar-r\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/aic-naar-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/aic-naar-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe aic in r te berekenen (inclusief voorbeelden)"}]},{"@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\/1750","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=1750"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1750\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}