{"id":843,"date":"2023-07-28T13:57:18","date_gmt":"2023-07-28T13:57:18","guid":{"rendered":"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/"},"modified":"2023-07-28T13:57:18","modified_gmt":"2023-07-28T13:57:18","slug":"chi-vierkante-goedheid-van-fit-testpython","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/","title":{"rendered":"Hoe u een chikwadraat-goodness-of-fit-test uitvoert in python"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Een<\/span> <strong><a href=\"https:\/\/statorials.org\/nl\/chi-kwadraat-goedheid-van-fit-test\/\" target=\"_blank\" rel=\"noopener\">chikwadraat-goodness-of-fit-test<\/a><\/strong> <span style=\"color: #000000;\">wordt gebruikt om te bepalen of een categorische variabele al dan niet een hypothetische verdeling volgt.<\/span><\/p>\n<p> <span style=\"color: #000000;\">In deze tutorial wordt uitgelegd hoe u een chikwadraat-goodness-of-fit-test uitvoert in Python.<\/span><\/p>\n<h3> <strong>Voorbeeld: Chi-kwadraat goodness-of-fit-test in Python<\/strong><\/h3>\n<p> <span style=\"color: #000000;\">Een winkeleigenaar vertelt dat er elke dag van de week evenveel klanten naar zijn winkel komen. Om deze hypothese te testen, registreert een onderzoeker het aantal klanten dat in een bepaalde week de winkel binnenkomt en ontdekt het volgende:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>Maandag:<\/strong> 50 klanten<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>Dinsdag:<\/strong> 60 klanten<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>Woensdag:<\/strong> 40 klanten<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>Donderdag:<\/strong> 47 klanten<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>Vrijdag:<\/strong> 53 klanten<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Gebruik de volgende stappen om een chi-kwadraat-goodness-of-fit-test uit te voeren in Python om te bepalen of de gegevens consistent zijn met de claim van de winkeleigenaar.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Stap 1: Cre\u00eber de gegevens.<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Eerst maken we twee tabellen met ons waargenomen en verwachte aantal klanten voor elke dag:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>expected = [50, 50, 50, 50, 50]\nobserved = [50, 60, 40, 47, 53]\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><strong>Stap 2: Voer de chikwadraat-goodness-of-fit-test uit.<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Vervolgens kunnen we de chi-kwadraat-goodness-of-fit-test uitvoeren met behulp van de <a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.stats.chisquare.html\" target=\"_blank\" rel=\"noopener\">chi-kwadraatfunctie<\/a> uit de SciPy-bibliotheek, die de volgende syntaxis gebruikt:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>chi kwadraat (f_obs, f_exp)<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Goud:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>f_obs:<\/strong> een reeks waargenomen tellingen.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>f_exp:<\/strong> een reeks verwachte tellingen. Standaard wordt aangenomen dat elke categorie even waarschijnlijk is.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u deze functie kunt gebruiken in ons specifieke voorbeeld:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">import<\/span> scipy.stats <span style=\"color: #107d3f;\">as<\/span> stats\n\n<span style=\"color: #008080;\">#perform Chi-Square Goodness of Fit Test<\/span>\nstats.chisquare(f_obs=observed, f_exp=expected)\n\n(statistic=4.36, pvalue=0.35947)\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De Chi-kwadraat-teststatistiek is <strong>4,36<\/strong> en de overeenkomstige p-waarde is <strong>0,35947<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">Merk op dat de p-waarde overeenkomt met een Chi-kwadraatwaarde met n-1 vrijheidsgraden (dof), waarbij n het aantal verschillende categorie\u00ebn is. In dit geval is dof = 5-1 = 4. U kunt de<a href=\"https:\/\/statorials.org\/nl\/chi-kwadraat-p-waardecalculator\/\" target=\"_blank\" rel=\"noopener\">chikwadraat-naar-P-waardecalculator<\/a> gebruiken om te bevestigen dat de p-waarde die overeenkomt met X <sup>2<\/sup> = 4,36 met dof = 4 <strong>0,35947<\/strong> is.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Bedenk dat een chikwadraat-goodness-of-fit-test de volgende nul- en alternatieve hypothesen gebruikt:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>H <sub>0<\/sub> : (nulhypothese)<\/strong> Een variabele volgt een hypothetische verdeling.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>H <sub>1<\/sub> : (alternatieve hypothese)<\/strong> Een variabele volgt geen hypothetische verdeling.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Omdat de p-waarde (0,35947) niet kleiner is dan 0,05, slagen we er niet in de nulhypothese te verwerpen. Dit betekent dat we niet genoeg bewijs hebben om te zeggen dat de werkelijke distributie van klanten verschilt van die gerapporteerd door de winkeleigenaar.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Een chikwadraat-goodness-of-fit-test wordt gebruikt om te bepalen of een categorische variabele al dan niet een hypothetische verdeling volgt. In deze tutorial wordt uitgelegd hoe u een chikwadraat-goodness-of-fit-test uitvoert in Python. Voorbeeld: Chi-kwadraat goodness-of-fit-test in Python Een winkeleigenaar vertelt dat er elke dag van de week evenveel klanten naar zijn winkel komen. Om deze hypothese te [&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-843","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>Een chikwadraat-goodness-of-fit-test uitvoeren in Python - Statorials<\/title>\n<meta name=\"description\" content=\"Een eenvoudige uitleg over het uitvoeren van een chikwadraat-goodness-of-fit-test in Python.\" \/>\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\/chi-vierkante-goedheid-van-fit-testpython\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Een chikwadraat-goodness-of-fit-test uitvoeren in Python - Statorials\" \/>\n<meta property=\"og:description\" content=\"Een eenvoudige uitleg over het uitvoeren van een chikwadraat-goodness-of-fit-test in Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-28T13:57:18+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=\"2\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/\",\"url\":\"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/\",\"name\":\"Een chikwadraat-goodness-of-fit-test uitvoeren in Python - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-28T13:57:18+00:00\",\"dateModified\":\"2023-07-28T13:57:18+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"Een eenvoudige uitleg over het uitvoeren van een chikwadraat-goodness-of-fit-test in Python.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe u een chikwadraat-goodness-of-fit-test uitvoert in python\"}]},{\"@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":"Een chikwadraat-goodness-of-fit-test uitvoeren in Python - Statorials","description":"Een eenvoudige uitleg over het uitvoeren van een chikwadraat-goodness-of-fit-test in Python.","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\/chi-vierkante-goedheid-van-fit-testpython\/","og_locale":"de_DE","og_type":"article","og_title":"Een chikwadraat-goodness-of-fit-test uitvoeren in Python - Statorials","og_description":"Een eenvoudige uitleg over het uitvoeren van een chikwadraat-goodness-of-fit-test in Python.","og_url":"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/","og_site_name":"Statorials","article_published_time":"2023-07-28T13:57:18+00:00","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\/chi-vierkante-goedheid-van-fit-testpython\/","url":"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/","name":"Een chikwadraat-goodness-of-fit-test uitvoeren in Python - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-28T13:57:18+00:00","dateModified":"2023-07-28T13:57:18+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"Een eenvoudige uitleg over het uitvoeren van een chikwadraat-goodness-of-fit-test in Python.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/chi-vierkante-goedheid-van-fit-testpython\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe u een chikwadraat-goodness-of-fit-test uitvoert in python"}]},{"@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\/843","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=843"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/843\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}