{"id":494,"date":"2023-07-29T17:32:33","date_gmt":"2023-07-29T17:32:33","guid":{"rendered":"https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/"},"modified":"2023-07-29T17:32:33","modified_gmt":"2023-07-29T17:32:33","slug":"plot-de-chi-kwadraatverdeling-in-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/","title":{"rendered":"Hoe u eenvoudig een chi-kwadraatverdeling in r kunt plotten"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Om een dichtheidsplot voor een Chi-kwadraatverdeling in R te maken, kunnen we de volgende functies gebruiken:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>dchisq()<\/strong> om de kansdichtheidsfunctie te maken<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>Curve()<\/strong> om de kansdichtheidsfunctie te plotten<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Het enige dat we hoeven te doen om de plot te maken, is het opgeven van de <em>vrijheidsgraden<\/em> voor <strong>dchisq()<\/strong> en de <em>uit-<\/em> en <em>terugpunten<\/em> voor <strong>curve()<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">De volgende code illustreert bijvoorbeeld hoe u een dichtheidsplot maakt voor een Chi-kwadraatverdeling met 10 vrijheidsgraden waarbij de x-as van de grafiek tussen 0 en 40 ligt:<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong>curve(dchisq(x, df = 10), from = 0, to = 40)\n<\/strong><\/pre>\n<h2> <span style=\"color: #000000;\"><strong>De dichtheidsplot bewerken<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">We kunnen de dichtheidsplot ook bewerken door een titel toe te voegen, het label op de Y-as te wijzigen, de lijnbreedte te vergroten en de lijnkleur te wijzigen:<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong>curve(dchisq(x, df = 10), from = 0, to = 40,\n      main = 'Chi-Square Distribution (df = 10)', <span style=\"color: #008080;\">#add title<\/span>\n      ylab = 'Density', <span style=\"color: #008080;\">#change y-axis label<\/span>\n      lwd = 2, <span style=\"color: #008080;\">#increase line width to 2<\/span>\n      col = 'steelblue') <span style=\"color: #008080;\">#change line color to steelblue<\/span><\/strong><\/pre>\n<h2> <span style=\"color: #000000;\"><strong>Vul de dichtheidsplot in<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Naast het maken van de dichtheidsplot, kunnen we een deel van de plot vullen met behulp van de <strong>polygon()-<\/strong> functie op basis van een begin- en eindwaarde.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u het dichtheidsgedeelte van de grafiek invult voor x-waarden tussen 10 en 40:<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create density curve\n<span style=\"color: #000000;\">curve(dchisq(x, df = 10), from = 0, to = 40,<\/span>\n<span style=\"color: #000000;\">main = 'Chi-Square Distribution (df = 10)',<\/span>\n<span style=\"color: #000000;\">ylab = 'Density',<\/span>\n<span style=\"color: #000000;\">lwd = 2)<\/span>\n\n#create vector of x values<\/span>\nx_vector &lt;- seq(10, 40)\n\n<span style=\"color: #008080;\">#create vector of chi-square density values\n<\/span>p_vector &lt;- dchisq(x_vector, df = 10)\n\n<span style=\"color: #008080;\">#fill in portion of the density plot from 0 to 40\n<\/span>polygon(c(x_vector, rev(x_vector)), c(p_vector, rep(0, length(p_vector))),\n        col = adjustcolor('red', alpha=0.3), border = NA)<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u het dichtheidsgedeelte van de plot invult voor x-waarden tussen 0 en 10:<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create density curve\n<span style=\"color: #000000;\">curve(dchisq(x, df = 10), from = 0, to = 40,<\/span>\n<span style=\"color: #000000;\">main = 'Chi-Square Distribution (df = 10)',<\/span>\n<span style=\"color: #000000;\">ylab = 'Density',<\/span>\n<span style=\"color: #000000;\">lwd = 2)<\/span>\n\n#create vector of x values\n<\/span>x_vector &lt;- seq( <span style=\"color: #800080;\">0, 10<\/span> )\n\n<span style=\"color: #008080;\">#create vector of chi-square density values\n<\/span>p_vector &lt;- dchisq(x_vector, df = 10)\n\n<span style=\"color: #008080;\">#fill in portion of the density plot from 0 to 10\n<\/span>polygon(c(x_vector, rev(x_vector)), c(p_vector, rep(0, length(p_vector))),\n        col = adjustcolor('red', alpha=0.3), border = NA)<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De volgende code illustreert hoe u het gedeelte van de dichtheidsplot invult voor x-waarden <em>buiten<\/em> de centrale 95% van de verdeling:<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create density curve\n<\/span>curve(dchisq(x, df = 10), from = 0, to = 40,\nmain = 'Chi-Square Distribution (df = 10)',\nylab = 'Density',\nlwd = 2)\n\n<span style=\"color: #008080;\">#find upper and lower values for middle 95% of distribution\n<\/span>lower95 &lt;- qchisq(.025, 10)\nupper95 &lt;- qchisq(.975, 10)\n\n<span style=\"color: #008080;\">#create vector of x values\n<\/span>x_lower95 &lt;- seq(0, lower95)\n\n<span style=\"color: #008080;\">#create vector of chi-square density values\n<\/span>p_lower95 &lt;- dchisq(x_lower95, df = 10)\n\n<span style=\"color: #008080;\">#fill in portion of the density plot from 0 to lower 95% value\n<\/span>polygon(c(x_lower95, rev(x_lower95)), c(p_lower95, rep(0, length(p_lower95))),\n        col = adjustcolor('red', alpha=0.3), border = NA)\n\n<span style=\"color: #008080;\">#create vector of x values\n<\/span>x_upper95 &lt;- seq(upper95, 40)\n\n<span style=\"color: #008080;\">#create vector of chi-square density values\n<\/span>p_upper95 &lt;- dchisq(x_upper95, df = 10)\n\n<span style=\"color: #008080;\">#fill in portion of the density plot for upper 95% value to end of plot\n<\/span>polygon(c(x_upper95, rev(x_upper95)), c(p_upper95, rep(0, length(p_upper95))),\n        col = adjustcolor('red', alpha=0.3), border = NA)<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Ten slotte illustreert de volgende code hoe u het gedeelte van de dichtheidsplot invult voor x-waarden die <i>binnen<\/i> de centrale 95% van de verdeling vallen:<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create density curve\n<\/span>curve(dchisq(x, df = 10), from = 0, to = 40,\nmain = 'Chi-Square Distribution (df = 10)',\nylab = 'Density',\nlwd = 2)\n\n<span style=\"color: #008080;\">#find upper and lower values for middle 95% of distribution\n<\/span>lower95 &lt;- qchisq(.025, 10)\nupper95 &lt;- qchisq(.975, 10)\n\n<span style=\"color: #008080;\">#create vector of x values\n<\/span>x_vector &lt;- seq(lower95, upper95)\n\n<span style=\"color: #008080;\">#create vector of chi-square density values\n<\/span>p_vector &lt;- dchisq(x_vector, df = 10)\n\n<span style=\"color: #008080;\">#fill in density plot\n<\/span>polygon(c(x_vector, rev(x_vector)), c(p_vector, rep(0, length(p_vector))),\n        col = adjustcolor('red', alpha=0.3), border = NA)<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Om een dichtheidsplot voor een Chi-kwadraatverdeling in R te maken, kunnen we de volgende functies gebruiken: dchisq() om de kansdichtheidsfunctie te maken Curve() om de kansdichtheidsfunctie te plotten Het enige dat we hoeven te doen om de plot te maken, is het opgeven van de vrijheidsgraden voor dchisq() en de uit- en terugpunten voor curve() [&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-494","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 eenvoudig een Chi-kwadraatverdeling in R kunt plotten - Statorials<\/title>\n<meta name=\"description\" content=\"Een eenvoudige uitleg over het plotten van een Chi-kwadraatverdeling in R.\" \/>\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\/plot-de-chi-kwadraatverdeling-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe u eenvoudig een Chi-kwadraatverdeling in R kunt plotten - Statorials\" \/>\n<meta property=\"og:description\" content=\"Een eenvoudige uitleg over het plotten van een Chi-kwadraatverdeling in R.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-29T17:32:33+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\/plot-de-chi-kwadraatverdeling-in-r\/\",\"url\":\"https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/\",\"name\":\"Hoe u eenvoudig een Chi-kwadraatverdeling in R kunt plotten - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-29T17:32:33+00:00\",\"dateModified\":\"2023-07-29T17:32:33+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"Een eenvoudige uitleg over het plotten van een Chi-kwadraatverdeling in R.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe u eenvoudig een chi-kwadraatverdeling in r kunt plotten\"}]},{\"@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 eenvoudig een Chi-kwadraatverdeling in R kunt plotten - Statorials","description":"Een eenvoudige uitleg over het plotten van een Chi-kwadraatverdeling in R.","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\/plot-de-chi-kwadraatverdeling-in-r\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe u eenvoudig een Chi-kwadraatverdeling in R kunt plotten - Statorials","og_description":"Een eenvoudige uitleg over het plotten van een Chi-kwadraatverdeling in R.","og_url":"https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/","og_site_name":"Statorials","article_published_time":"2023-07-29T17:32:33+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\/plot-de-chi-kwadraatverdeling-in-r\/","url":"https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/","name":"Hoe u eenvoudig een Chi-kwadraatverdeling in R kunt plotten - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-29T17:32:33+00:00","dateModified":"2023-07-29T17:32:33+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"Een eenvoudige uitleg over het plotten van een Chi-kwadraatverdeling in R.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/plot-de-chi-kwadraatverdeling-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe u eenvoudig een chi-kwadraatverdeling in r kunt plotten"}]},{"@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\/494","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=494"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/494\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}