{"id":1568,"date":"2023-07-25T20:17:43","date_gmt":"2023-07-25T20:17:43","guid":{"rendered":"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/"},"modified":"2023-07-25T20:17:43","modified_gmt":"2023-07-25T20:17:43","slug":"histogramm-mit-zwei-variablen-in-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/","title":{"rendered":"So erstellen sie ein histogramm zweier variablen in r"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Ein Histogramm ist eine n\u00fctzliche M\u00f6glichkeit, die Werteverteilung f\u00fcr eine bestimmte Variable zu visualisieren.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Um ein Histogramm f\u00fcr eine Variable in R zu erstellen, k\u00f6nnen Sie die Funktion <strong>hist()<\/strong> verwenden. Und um ein Histogramm f\u00fcr zwei Variablen in R zu erstellen, k\u00f6nnen Sie die folgende Syntax verwenden:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>hist(variable1, col=' <span style=\"color: #008000;\">red<\/span> ')\nhist(variable2, col=' <span style=\"color: #008000;\">blue<\/span> ', add= <span style=\"color: #008000;\">TRUE<\/span> )\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Das folgende Beispiel zeigt, wie diese Syntax in der Praxis verwendet wird.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Beispiel: Erstellen Sie ein Histogramm zweier Variablen in R<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Der folgende Code zeigt, wie man ein Histogramm zweier Variablen in R erstellt:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#make this example reproducible\n<\/span>set. <span style=\"color: #3366ff;\">seeds<\/span> (1)\n\n<span style=\"color: #008080;\">#define data\n<\/span>x1 = rnorm(1000, mean=0.6, sd=0.1)\nx2 = rnorm(1000, mean=0.4, sd=0.1)\n\n<span style=\"color: #008080;\">#plot two histograms in same graph\n<\/span>hist(x1, col=' <span style=\"color: #008000;\">red<\/span> ')\nhist(x2, col=' <span style=\"color: #008000;\">blue<\/span> ', add= <span style=\"color: #008000;\">TRUE<\/span> )\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-15566 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/multhistr1.png\" alt=\"\" width=\"421\" height=\"429\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Da sich die Histogrammwerte \u00fcberschneiden, empfiehlt es sich <strong>, rgb()-<\/strong> Farben mit erh\u00f6hter Transparenz zu verwenden:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#make this example reproducible\n<\/span>set. <span style=\"color: #3366ff;\">seeds<\/span> (1)\n\n<span style=\"color: #008080;\">#define data\n<\/span>x1 = rnorm(1000, mean=0.6, sd=0.1)\nx2 = rnorm(1000, mean=0.4, sd=0.1)\n\n<span style=\"color: #008080;\">#plot two histograms in same graph\n<\/span>hist(x1, col=rgb(0,0,1,0.2), xlim=c(0, 1),\n     xlab=' <span style=\"color: #008000;\">Values<\/span> ', ylab=' <span style=\"color: #008000;\">Frequency<\/span> ', main=' <span style=\"color: #008000;\">Histogram for two variables<\/span> ')\nhist(x2, col=rgb(1,0,0,0.2), add= <span style=\"color: #008000;\">TRUE<\/span> )<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-15567\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/multhistr2.png\" alt=\"Histogramm f\u00fcr zwei Variablen in R\" width=\"445\" height=\"452\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Sie k\u00f6nnen auch eine Legende hinzuf\u00fcgen, um die Interpretation der Histogramme zu erleichtern:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#make this example reproducible\n<\/span>set. <span style=\"color: #3366ff;\">seeds<\/span> (1)\n\n<span style=\"color: #008080;\">#define data\n<\/span>x1 = rnorm(1000, mean=0.6, sd=0.1)\nx2 = rnorm(1000, mean=0.4, sd=0.1)\n\n<span style=\"color: #008080;\">#plot two histograms in same graph\n<\/span>hist(x1, col=rgb(0,0,1,0.2), xlim=c(0, 1),\n     xlab=' <span style=\"color: #008000;\">Values<\/span> ', ylab=' <span style=\"color: #008000;\">Frequency<\/span> ', main=' <span style=\"color: #008000;\">Histogram for two variables<\/span> ')\nhist(x2, col=rgb(1,0,0,0.2), add= <span style=\"color: #008000;\">TRUE<\/span> )\n\n<span style=\"color: #008080;\">#add legend<\/span>\nlegend(' <span style=\"color: #008000;\">topright<\/span> ', c(' <span style=\"color: #008000;\">Variable 1<\/span> ', ' <span style=\"color: #008000;\">Variable 2<\/span> '),\n       fill=c(rgb(0,0,1,0.2), rgb(1,0,0,0.2)))\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-15568 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/multhistr3.png\" alt=\"Histogramm zweier Variablen in Beispiel R\" width=\"453\" height=\"441\" srcset=\"\" sizes=\"\"><\/p>\n<hr>\n<p> <span style=\"color: #000000;\">Weitere R-Tutorials finden Sie auf <a href=\"https:\/\/statorials.org\/de\/die-statistik-erklart-konzepte-auf-einfache-und-direkte-weise.-wir-erleichtern-das-erlernen-von-statistiken\/\" target=\"_blank\" rel=\"noopener\">dieser Seite<\/a> .<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ein Histogramm ist eine n\u00fctzliche M\u00f6glichkeit, die Werteverteilung f\u00fcr eine bestimmte Variable zu visualisieren. Um ein Histogramm f\u00fcr eine Variable in R zu erstellen, k\u00f6nnen Sie die Funktion hist() verwenden. Und um ein Histogramm f\u00fcr zwei Variablen in R zu erstellen, k\u00f6nnen Sie die folgende Syntax verwenden: hist(variable1, col=&#8216; red &#8218;) hist(variable2, col=&#8216; blue &#8218;, [&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":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>So erstellen Sie ein Histogramm zweier Variablen in R<\/title>\n<meta name=\"description\" content=\"In diesem Tutorial wird anhand eines Beispiels erkl\u00e4rt, wie man ein Histogramm zweier Variablen in R erstellt.\" \/>\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\/de\/histogramm-mit-zwei-variablen-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"So erstellen Sie ein Histogramm zweier Variablen in R\" \/>\n<meta property=\"og:description\" content=\"In diesem Tutorial wird anhand eines Beispiels erkl\u00e4rt, wie man ein Histogramm zweier Variablen in R erstellt.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-25T20:17:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/multhistr1.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=\"1 Minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/\",\"url\":\"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/\",\"name\":\"So erstellen Sie ein Histogramm zweier Variablen in R\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/de\/#website\"},\"datePublished\":\"2023-07-25T20:17:43+00:00\",\"dateModified\":\"2023-07-25T20:17:43+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\"},\"description\":\"In diesem Tutorial wird anhand eines Beispiels erkl\u00e4rt, wie man ein Histogramm zweier Variablen in R erstellt.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/#breadcrumb\"},\"inLanguage\":\"de-DE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Heim\",\"item\":\"https:\/\/statorials.org\/de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"So erstellen sie ein histogramm zweier variablen in r\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/de\/#website\",\"url\":\"https:\/\/statorials.org\/de\/\",\"name\":\"Statorials\",\"description\":\"Ihr Leitfaden f\u00fcr statistische Kompetenz !\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/de\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de-DE\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\",\"name\":\"Dr. Benjamin Anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de-DE\",\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr. Benjamin Anderson\"},\"description\":\"Hallo, ich bin Benjamin, ein pensionierter Statistikprofessor, der sich zum engagierten Statorials-Lehrer entwickelt hat. Mit umfassender Erfahrung und Fachwissen auf dem Gebiet der Statistik bin ich bestrebt, mein Wissen zu teilen, um Studenten durch Statorials zu bef\u00e4higen. Mehr wissen\",\"sameAs\":[\"https:\/\/statorials.org\/de\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"So erstellen Sie ein Histogramm zweier Variablen in R","description":"In diesem Tutorial wird anhand eines Beispiels erkl\u00e4rt, wie man ein Histogramm zweier Variablen in R erstellt.","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\/de\/histogramm-mit-zwei-variablen-in-r\/","og_locale":"de_DE","og_type":"article","og_title":"So erstellen Sie ein Histogramm zweier Variablen in R","og_description":"In diesem Tutorial wird anhand eines Beispiels erkl\u00e4rt, wie man ein Histogramm zweier Variablen in R erstellt.","og_url":"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/","og_site_name":"Statorials","article_published_time":"2023-07-25T20:17:43+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/multhistr1.png"}],"author":"Dr. Benjamin Anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr. Benjamin Anderson","Gesch\u00e4tzte Lesezeit":"1 Minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/","url":"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/","name":"So erstellen Sie ein Histogramm zweier Variablen in R","isPartOf":{"@id":"https:\/\/statorials.org\/de\/#website"},"datePublished":"2023-07-25T20:17:43+00:00","dateModified":"2023-07-25T20:17:43+00:00","author":{"@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0"},"description":"In diesem Tutorial wird anhand eines Beispiels erkl\u00e4rt, wie man ein Histogramm zweier Variablen in R erstellt.","breadcrumb":{"@id":"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/#breadcrumb"},"inLanguage":"de-DE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/de\/histogramm-mit-zwei-variablen-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Heim","item":"https:\/\/statorials.org\/de\/"},{"@type":"ListItem","position":2,"name":"So erstellen sie ein histogramm zweier variablen in r"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/de\/#website","url":"https:\/\/statorials.org\/de\/","name":"Statorials","description":"Ihr Leitfaden f\u00fcr statistische Kompetenz !","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/de\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de-DE"},{"@type":"Person","@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0","name":"Dr. Benjamin Anderson","image":{"@type":"ImageObject","inLanguage":"de-DE","@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","caption":"Dr. Benjamin Anderson"},"description":"Hallo, ich bin Benjamin, ein pensionierter Statistikprofessor, der sich zum engagierten Statorials-Lehrer entwickelt hat. Mit umfassender Erfahrung und Fachwissen auf dem Gebiet der Statistik bin ich bestrebt, mein Wissen zu teilen, um Studenten durch Statorials zu bef\u00e4higen. Mehr wissen","sameAs":["https:\/\/statorials.org\/de"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/1568"}],"collection":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/comments?post=1568"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/1568\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/media?parent=1568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/categories?post=1568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/tags?post=1568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}