{"id":1452,"date":"2023-07-26T08:19:00","date_gmt":"2023-07-26T08:19:00","guid":{"rendered":"https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/"},"modified":"2023-07-26T08:19:00","modified_gmt":"2023-07-26T08:19:00","slug":"logaritmische-regressie-in-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/","title":{"rendered":"Logaritmische regressie in r (stap voor stap)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\"><strong>Logaritmische regressie<\/strong> is een soort regressie die wordt gebruikt om situaties te modelleren waarin de groei of achteruitgang eerst snel versnelt en vervolgens in de loop van de tijd vertraagt.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De volgende grafiek toont bijvoorbeeld een voorbeeld van logaritmisch verval:<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-14289 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/expregexcel2.png\" alt=\"\" width=\"375\" height=\"284\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Voor dit soort situaties zou de relatie tussen een voorspellende variabele en een responsvariabele goed kunnen worden gemodelleerd met behulp van logaritmische regressie.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De vergelijking voor een logaritmisch regressiemodel heeft de volgende vorm:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>y = a + b*ln(x)<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Goud:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>y:<\/strong> de responsvariabele<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>x:<\/strong> de voorspellende variabele<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>a, b:<\/strong> de regressieco\u00ebffici\u00ebnten die de relatie tussen <em>x<\/em> en <em>y<\/em> beschrijven<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Het volgende stapsgewijze voorbeeld laat zien hoe u logaritmische regressie in R uitvoert.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Stap 1: Cre\u00eber de gegevens<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Laten we eerst valse gegevens maken voor twee variabelen: <em>x<\/em> en <em>y<\/em> :<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>x=1:15\n\ny=c(59, 50, 44, 38, 33, 28, 23, 20, 17, 15, 13, 12, 11, 10, 9.5)\n<\/strong><\/pre>\n<h3> <strong>Stap 2: Visualiseer de gegevens<\/strong><\/h3>\n<p> <span style=\"color: #000000;\">Laten we vervolgens een snelle spreidingsdiagram maken om de relatie tussen <em>x<\/em> en <em>y<\/em> te visualiseren:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>plot(x, y)<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-14369 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/logregr1.png\" alt=\"\" width=\"467\" height=\"426\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Uit de grafiek kunnen we zien dat er een duidelijk logaritmisch vervalpatroon bestaat tussen de twee variabelen. De waarde van de responsvariabele <em>y<\/em> neemt eerst snel af en vertraagt vervolgens in de loop van de tijd.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Het lijkt daarom verstandig om een logaritmische regressievergelijking toe te passen om de relatie tussen de variabelen te beschrijven.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Stap 3: Pas het logaritmische regressiemodel aan<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Vervolgens zullen we de functie <strong>lm()<\/strong> gebruiken om een logaritmisch regressiemodel te fitten, waarbij we de natuurlijke logaritme van <em>x<\/em> als voorspellende variabele en <em>y<\/em> als responsvariabele gebruiken.<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#fit the model<\/span>\nmodel &lt;- lm(y ~ <span style=\"color: #3366ff;\">log<\/span> (x))<\/strong>\n<strong>\n<span style=\"color: #008080;\">#view the output of the model<\/span>\nsummary(model)\n\nCall:\nlm(formula = y ~ log(x))\n\nResiduals:\n   Min 1Q Median 3Q Max \n-4.069 -1.313 -0.260 1.127 3.122 \n\nCoefficients:\n            Estimate Std. Error t value Pr(&gt;|t|)    \n(Intercept) 63.0686 1.4090 44.76 1.25e-15 ***\nlog(x) -20.1987 0.7019 -28.78 3.70e-13 ***\n---\nSignificant. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1\n\nResidual standard error: 2.054 on 13 degrees of freedom\nMultiple R-squared: 0.9845, Adjusted R-squared: 0.9834 \nF-statistic: 828.2 on 1 and 13 DF, p-value: 3.702e-13<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De <a href=\"https:\/\/statorials.org\/nl\/een-eenvoudige-gids-voor-het-begrijpen-van-de-f-toets-voor-de-algehele-significantie-bij-regressie\/\" target=\"_blank\" rel=\"noopener\">totale F-waarde<\/a> van het model is 828,2 en de overeenkomstige p-waarde is extreem laag (3,702e-13), wat aangeeft dat het model als geheel bruikbaar is.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Met behulp van de co\u00ebffici\u00ebnten uit de uitvoertabel kunnen we zien dat de aangepaste logaritmische regressievergelijking is:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>y = 63,0686 \u2013 20,1987 * ln(x)<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">We kunnen deze vergelijking gebruiken om de responsvariabele, <em>y<\/em> , te voorspellen op basis van de waarde van de voorspellende variabele, <em>x<\/em> . Als <em>x<\/em> = 12, dan voorspellen we bijvoorbeeld dat <em>y<\/em> <strong>12,87<\/strong> zou zijn:<\/span><\/p>\n<p> <span style=\"color: #000000;\">y = 63,0686 \u2013 20,1987 * ln(12) = <strong>12,87<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Bonus:<\/strong> voel je vrij om deze online logaritmische regressiecalculator te gebruiken om automatisch de logaritmische regressievergelijking voor een bepaalde voorspeller en responsvariabele te berekenen.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Stap 4: Visualiseer het logaritmische regressiemodel<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">Ten slotte kunnen we een snelle grafiek maken om te visualiseren hoe goed het logaritmische regressiemodel bij de gegevens past:<\/span><\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#plot x vs. y<\/span>\nplot(x, y)\n\n<span style=\"color: #008080;\">#define x-values to use for regression line\n<\/span>x=seq(from= <span style=\"color: #008000;\">1<\/span> , to= <span style=\"color: #008000;\">15<\/span> , length. <span style=\"color: #3366ff;\">out<\/span> = <span style=\"color: #008000;\">1000<\/span> )\n\n<span style=\"color: #008080;\">#use the model to predict the y-values based on the x-values\n<\/span>y=predict(model,newdata=list(x=seq(from= <span style=\"color: #008000;\">1<\/span> ,to= <span style=\"color: #008000;\">15<\/span> ,length. <span style=\"color: #3366ff;\">out<\/span> = <span style=\"color: #008000;\">1000<\/span> )),\n          interval=\" <span style=\"color: #008000;\">confidence<\/span> \")\n\n<span style=\"color: #008080;\">#add the fitted regression line to the plot (lwd specifies the width of the line)\n<\/span>matlines(x,y, lwd= <span style=\"color: #008000;\">2<\/span> )\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-14370 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/logregr2.png\" alt=\"Logaritmische regressie in R\" width=\"441\" height=\"389\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">We kunnen zien dat het logaritmische regressiemodel goed aansluit bij deze specifieke dataset.<\/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\/kwadratische-regressie-r\/\" target=\"_blank\" rel=\"noopener\">Hoe kwadratische regressie uit te voeren in R<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/exponentiele-regressie-in-r\/\" target=\"_blank\" rel=\"noopener\">Hoe exponenti\u00eble regressie uit te voeren in R<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/polynomiale-regressie-r\/\" target=\"_blank\" rel=\"noopener\">Hoe polynomiale regressie uit te voeren in R<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Logaritmische regressie is een soort regressie die wordt gebruikt om situaties te modelleren waarin de groei of achteruitgang eerst snel versnelt en vervolgens in de loop van de tijd vertraagt. De volgende grafiek toont bijvoorbeeld een voorbeeld van logaritmisch verval: Voor dit soort situaties zou de relatie tussen een voorspellende variabele en een responsvariabele goed [&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-1452","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>Logaritmische regressie in R (stap voor stap)<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u logaritmische regressie in R uitvoert, inclusief 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\/logaritmische-regressie-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Logaritmische regressie in R (stap voor stap)\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u logaritmische regressie in R uitvoert, inclusief een stapsgewijs voorbeeld.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-26T08:19:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/expregexcel2.png\" \/>\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\/logaritmische-regressie-in-r\/\",\"url\":\"https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/\",\"name\":\"Logaritmische regressie in R (stap voor stap)\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-26T08:19:00+00:00\",\"dateModified\":\"2023-07-26T08:19:00+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u logaritmische regressie in R uitvoert, inclusief een stapsgewijs voorbeeld.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Logaritmische regressie in r (stap voor stap)\"}]},{\"@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":"Logaritmische regressie in R (stap voor stap)","description":"In deze tutorial wordt uitgelegd hoe u logaritmische regressie in R uitvoert, inclusief 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\/logaritmische-regressie-in-r\/","og_locale":"de_DE","og_type":"article","og_title":"Logaritmische regressie in R (stap voor stap)","og_description":"In deze tutorial wordt uitgelegd hoe u logaritmische regressie in R uitvoert, inclusief een stapsgewijs voorbeeld.","og_url":"https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/","og_site_name":"Statorials","article_published_time":"2023-07-26T08:19:00+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/expregexcel2.png"}],"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\/logaritmische-regressie-in-r\/","url":"https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/","name":"Logaritmische regressie in R (stap voor stap)","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-26T08:19:00+00:00","dateModified":"2023-07-26T08:19:00+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u logaritmische regressie in R uitvoert, inclusief een stapsgewijs voorbeeld.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/logaritmische-regressie-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Logaritmische regressie in r (stap voor stap)"}]},{"@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\/1452","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=1452"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1452\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}