{"id":17590,"date":"2020-11-26T16:45:25","date_gmt":"2020-11-26T16:45:25","guid":{"rendered":"http:\/\/www.wjst.de\/blog\/?p=17590"},"modified":"2020-11-26T18:50:59","modified_gmt":"2020-11-26T18:50:59","slug":"rki-daten-sind-tages-und-nicht-fallbasiert","status":"publish","type":"post","link":"https:\/\/www.wjst.de\/blog\/sciencesurf\/2020\/11\/rki-daten-sind-tages-und-nicht-fallbasiert\/","title":{"rendered":"RKI Daten sind tages- und nicht fallbasiert"},"content":{"rendered":"<p>Leider kann man mit den RKI Daten nicht direkt in ein Regressionsmodell gehen, weil an vielen Tagen mehr als ein Fall in derselben Kategorie auftritt<!--more--><\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nrki %&gt;%\r\nselect(date,AnzahlFall,Altersgruppe,Geschlecht) %&gt;%\r\ngroup_by(AnzahlFall) %&gt;%\r\ncount()\r\n<\/pre>\n<p><a href=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2020\/11\/s-5.jpg\" data-rel=\"key-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17591\" src=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2020\/11\/s-5.jpg\" alt=\"\" width=\"171\" height=\"221\" \/><\/a><\/p>\n<p>Das Expandieren des Datensatzes ist allerdings nicht ganz trivial. Hier mein <a href=\"https:\/\/dplyr.tidyverse.org\/\">dplyr<\/a> Versuch, der zuerst den Datensatz nach H\u00e4ufigkeitsgruppen zerlegt, wieder zusammenf\u00fcgt und zuletzt den Z\u00e4hler zur\u00fccksetzt.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nrki %&gt;%\r\n  bind_rows(tmp %&gt;%\r\n    group_by(AnzahlFall) %&gt;%\r\n    filter(last(AnzahlFall) &gt;1) %&gt;%\r\n    slice( rep(1:n(), last(AnzahlFall)-1 ) )\r\n  )  %&gt;%\r\n  mutate (AnzahlFall = case_when (AnzahlFall&gt;1 ~ 1, TRUE ~ as.numeric(AnzahlFall) ) )\r\n<\/pre>\n<p>Ich vermisse die R User Group M\u00fcnchen&#8230;.<\/p>\n\n<p>&nbsp;<\/p>\n<div class=\"bottom-note\">\n  <span class=\"mod1\">CC-BY-NC Science Surf , accessed 10.04.2026<\/span>\n <\/div>","protected":false},"excerpt":{"rendered":"<p>Leider kann man mit den RKI Daten nicht direkt in ein Regressionsmodell gehen, weil an vielen Tagen mehr als ein Fall in derselben Kategorie auftritt &nbsp; CC-BY-NC Science Surf , accessed 10.04.2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[3390,1295],"class_list":["post-17590","post","type-post","status-publish","format-standard","hentry","category-computer-software","tag-corona","tag-rki"],"_links":{"self":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/17590","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/comments?post=17590"}],"version-history":[{"count":9,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/17590\/revisions"}],"predecessor-version":[{"id":17600,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/17590\/revisions\/17600"}],"wp:attachment":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/media?parent=17590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/categories?post=17590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/tags?post=17590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}