{"id":1808,"date":"2023-07-24T22:03:16","date_gmt":"2023-07-24T22:03:16","guid":{"rendered":"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/"},"modified":"2023-07-24T22:03:16","modified_gmt":"2023-07-24T22:03:16","slug":"voeg-variabele-plot-r-toe","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/","title":{"rendered":"Hoe u toegevoegde variabele plots kunt maken in r"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">In de statistiek zijn <strong>toegevoegde variabele plots<\/strong> individuele plots die de relatie weergeven tussen een<a href=\"https:\/\/statorials.org\/nl\/variabelen-verklarende-reacties\/\" target=\"_blank\" rel=\"noopener\">responsvariabele<\/a> en een voorspellende variabele in een meervoudig lineair regressiemodel, terwijl wordt gecontroleerd voor de aanwezigheid van andere voorspellende variabelen in het model.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Opmerking:<\/strong> soms worden deze plots ook wel &#8218;parti\u00eble regressieplots&#8216; genoemd.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Met dit type plot kunnen we de relatie tussen elke individuele voorspellende variabele en de responsvariabele in een model observeren, terwijl andere voorspellende variabelen constant worden gehouden.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Om plots van toegevoegde variabelen in R te maken, kunnen we de functie <strong>avPlots()<\/strong> uit het <strong>car-<\/strong> pakket gebruiken:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#load <em>car<\/em> package\n<\/span><span style=\"color: #993300;\">library<\/span> (car) \n\n<span style=\"color: #008080;\">#fit multiple linear regression model\n<\/span>model &lt;- lm(y ~ x1 + x2 + ..., data = df)\n\n<span style=\"color: #008080;\">#create added variable plots\n<\/span>avPlots(model)\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Het volgende voorbeeld laat zien hoe u deze syntaxis in de praktijk kunt gebruiken.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld: Variabele plots toevoegen in R<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Stel dat we het volgende meervoudige lineaire regressiemodel in R passen, met behulp van gegevens uit de <strong>mtcars-<\/strong> dataset:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#fit multiple linear regression model\n<\/span>model &lt;- lm(mpg ~ disp + hp + drat, data = mtcars)\n\n<span style=\"color: #008080;\">#view summary of model\n<\/span>summary(model)\n\nCall:\nlm(formula = mpg ~ disp + hp + drat, data = mtcars)\n\nResiduals:\n    Min 1Q Median 3Q Max \n-5.1225 -1.8454 -0.4456 1.1342 6.4958 \n\nCoefficients:\n             Estimate Std. Error t value Pr(&gt;|t|)   \n(Intercept) 19.344293 6.370882 3.036 0.00513 **\navailable -0.019232 0.009371 -2.052 0.04960 * \nhp -0.031229 0.013345 -2.340 0.02663 * \ndrat 2.714975 1.487366 1.825 0.07863 . \n---\nSignificant. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1\n\nResidual standard error: 3.008 on 28 degrees of freedom\nMultiple R-squared: 0.775, Adjusted R-squared: 0.7509 \nF-statistic: 32.15 on 3 and 28 DF, p-value: 3.28e-09<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Om de relatie tussen de responsvariabele &#8222;mpg&#8220; en elke individuele voorspellende variabele in het model te visualiseren, kunnen we grafieken van toegevoegde variabelen maken met behulp van de functie <strong>avPlots()<\/strong> :<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#load car package\n<span style=\"color: #000000;\"><span style=\"color: #993300;\">library<\/span> (car)\n<\/span>\n#produce added variable plots\n<span style=\"color: #000000;\">avPlots(model)<\/span>\n<\/span><\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-12861\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/ajoutevarplots1.png\" alt=\"Een variabele plot toevoegen in R\" width=\"503\" height=\"507\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Zo interpreteer je elk plot:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">Op de x-as wordt een enkele voorspellende variabele weergegeven en op de y-as de responsvariabele.<\/span><\/li>\n<li> <span style=\"color: #000000;\">De blauwe lijn toont het verband tussen de voorspellende variabele en de responsvariabele, <em>terwijl de waarde van alle andere voorspellende variabelen constant wordt gehouden<\/em> .<\/span><\/li>\n<li> <span style=\"color: #000000;\">De gelabelde punten in elke grafiek vertegenwoordigen de twee waarnemingen met de grootste <a href=\"https:\/\/statorials.org\/nl\/residu\/\" target=\"_blank\" rel=\"noopener\">residuen<\/a> en de twee waarnemingen met de grootste gedeeltelijke invloed.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Merk op dat de hoek van de lijn in elke grafiek overeenkomt met het teken van de co\u00ebffici\u00ebnt van de geschatte regressievergelijking.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Hier volgen bijvoorbeeld de geschatte co\u00ebffici\u00ebnten voor elke voorspellende variabele in het model:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>weergave:<\/strong> -0,019232<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>ch:<\/strong> -0,031229<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>datum:<\/strong> 2.714975<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Merk op dat de hoek van de lijn positief is in de toegevoegde variabele grafiek voor <em>drat<\/em> , terwijl deze negatief is voor <em>disp<\/em> en <em>hp<\/em> , wat overeenkomt met de tekens van hun geschatte co\u00ebffici\u00ebnten:<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-12864\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/ajoutevarplots2.png\" alt=\"Hoe toegevoegde variabele plots te interpreteren\" width=\"473\" height=\"495\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Met deze grafieken kunnen we eenvoudig de relatie tussen elke individuele voorspellende variabele en de responsvariabele visualiseren.<\/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 \/> Hoe logistische regressie uit te voeren in R<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In de statistiek zijn toegevoegde variabele plots individuele plots die de relatie weergeven tussen eenresponsvariabele en een voorspellende variabele in een meervoudig lineair regressiemodel, terwijl wordt gecontroleerd voor de aanwezigheid van andere voorspellende variabelen in het model. Opmerking: soms worden deze plots ook wel &#8218;parti\u00eble regressieplots&#8216; genoemd. Met dit type plot kunnen we de relatie [&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-1808","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 u toegevoegde variabele plots kunt maken in R - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u toegevoegde variabelenplots in R maakt en interpreteert, 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\/voeg-variabele-plot-r-toe\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe u toegevoegde variabele plots kunt maken in R - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u toegevoegde variabelenplots in R maakt en interpreteert, inclusief een stapsgewijs voorbeeld.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-24T22:03:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/ajoutevarplots1.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=\"2\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/\",\"url\":\"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/\",\"name\":\"Hoe u toegevoegde variabele plots kunt maken in R - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-24T22:03:16+00:00\",\"dateModified\":\"2023-07-24T22:03:16+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u toegevoegde variabelenplots in R maakt en interpreteert, inclusief een stapsgewijs voorbeeld.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe u toegevoegde variabele plots kunt maken 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 u toegevoegde variabele plots kunt maken in R - Statorials","description":"In deze tutorial wordt uitgelegd hoe u toegevoegde variabelenplots in R maakt en interpreteert, 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\/voeg-variabele-plot-r-toe\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe u toegevoegde variabele plots kunt maken in R - Statorials","og_description":"In deze tutorial wordt uitgelegd hoe u toegevoegde variabelenplots in R maakt en interpreteert, inclusief een stapsgewijs voorbeeld.","og_url":"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/","og_site_name":"Statorials","article_published_time":"2023-07-24T22:03:16+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/ajoutevarplots1.png"}],"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\/voeg-variabele-plot-r-toe\/","url":"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/","name":"Hoe u toegevoegde variabele plots kunt maken in R - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-24T22:03:16+00:00","dateModified":"2023-07-24T22:03:16+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u toegevoegde variabelenplots in R maakt en interpreteert, inclusief een stapsgewijs voorbeeld.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/voeg-variabele-plot-r-toe\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe u toegevoegde variabele plots kunt maken 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\/1808","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=1808"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1808\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}