{"id":855,"date":"2023-07-28T12:52:59","date_gmt":"2023-07-28T12:52:59","guid":{"rendered":"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/"},"modified":"2023-07-28T12:52:59","modified_gmt":"2023-07-28T12:52:59","slug":"kruskal-wallis-teste-python","status":"publish","type":"post","link":"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/","title":{"rendered":"Como realizar um teste kruskal-wallis em python"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Um <a href=\"https:\/\/statorials.org\/pt\/teste-kruskal-wallis\/\" target=\"_blank\" rel=\"noopener\">teste de Kruskal-Wallis<\/a> \u00e9 usado para determinar se h\u00e1 ou n\u00e3o diferen\u00e7a estatisticamente significativa entre as medianas de tr\u00eas ou mais grupos independentes.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u00c9 considerado o equivalente n\u00e3o param\u00e9trico da <a href=\"https:\/\/statorials.org\/pt\/unidirecional-anova-python\/\" target=\"_blank\" rel=\"noopener\">ANOVA unidirecional<\/a> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">Este tutorial explica como realizar um teste Kruskal-Wallis em Python.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Exemplo: teste Kruskal-Wallis em Python<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Os pesquisadores querem saber se tr\u00eas fertilizantes diferentes levam a diferentes n\u00edveis de crescimento das plantas. Eles selecionam aleatoriamente 30 plantas diferentes e as dividem em tr\u00eas grupos de 10, aplicando um fertilizante diferente em cada grupo. Depois de um m\u00eas, medem a altura de cada planta.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Siga as etapas a seguir para realizar um teste de Kruskal-Wallis para determinar se o crescimento m\u00e9dio \u00e9 o mesmo em todos os tr\u00eas grupos.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Passo 1: Insira os dados.<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Primeiro, criaremos tr\u00eas tabelas para armazenar as medidas de nossas plantas para cada um dos tr\u00eas grupos:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>group1 = [7, 14, 14, 13, 12, 9, 6, 14, 12, 8]\ngroup2 = [15, 17, 13, 15, 15, 13, 9, 12, 10, 8]\ngroup3 = [6, 8, 8, 9, 5, 14, 13, 8, 10, 9]\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><strong>Passo 2: Realize o teste de Kruskal-Wallis.<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">A seguir, realizaremos um teste Kruskal-Wallis usando a <a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.stats.kruskal.html\" target=\"_blank\" rel=\"noopener\">fun\u00e7\u00e3o kruskal()<\/a> da biblioteca scipy.stats:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">from<\/span> scipy <span style=\"color: #107d3f;\">import<\/span> stats\n\n<span style=\"color: #008080;\">#perform Kruskal-Wallis Test<\/span> \nstats.kruskal(group1, group2, group3)\n\n(statistic=6.2878, pvalue=0.0431)\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><strong>Etapa 3: interprete os resultados.<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">O teste Kruskal-Wallis utiliza as seguintes hip\u00f3teses nulas e alternativas:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>A hip\u00f3tese nula (H <sub>0<\/sub> ):<\/strong> A mediana \u00e9 igual em todos os grupos.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>A hip\u00f3tese alternativa: (Ha):<\/strong> A mediana <em>n\u00e3o<\/em> \u00e9 igual em todos os grupos.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Nesse caso, a estat\u00edstica de teste \u00e9 <strong>6,2878<\/strong> e o valor p correspondente \u00e9 <strong>0,0431<\/strong> . Como este valor p \u00e9 inferior a 0,05, podemos rejeitar a hip\u00f3tese nula de que o crescimento m\u00e9dio das plantas \u00e9 o mesmo para todos os tr\u00eas fertilizantes. Temos evid\u00eancias suficientes para concluir que o tipo de fertilizante utilizado causa diferen\u00e7as estatisticamente significativas no crescimento das plantas.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Um teste de Kruskal-Wallis \u00e9 usado para determinar se h\u00e1 ou n\u00e3o diferen\u00e7a estatisticamente significativa entre as medianas de tr\u00eas ou mais grupos independentes. \u00c9 considerado o equivalente n\u00e3o param\u00e9trico da ANOVA unidirecional . Este tutorial explica como realizar um teste Kruskal-Wallis em Python. Exemplo: teste Kruskal-Wallis em Python Os pesquisadores querem saber se tr\u00eas [&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-855","post","type-post","status-publish","format-standard","hentry","category-guia"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Como realizar um teste Kruskal-Wallis em Python - Estatologia<\/title>\n<meta name=\"description\" content=\"Uma explica\u00e7\u00e3o simples de como realizar uma interpreta\u00e7\u00e3o de teste Kruskal-Wallis em 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\/pt\/kruskal-wallis-teste-python\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Como realizar um teste Kruskal-Wallis em Python - Estatologia\" \/>\n<meta property=\"og:description\" content=\"Uma explica\u00e7\u00e3o simples de como realizar uma interpreta\u00e7\u00e3o de teste Kruskal-Wallis em Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-28T12:52:59+00:00\" \/>\n<meta name=\"author\" content=\"Dr. benjamim anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr. benjamim anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo estimado de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/\",\"url\":\"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/\",\"name\":\"Como realizar um teste Kruskal-Wallis em Python - Estatologia\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/pt\/#website\"},\"datePublished\":\"2023-07-28T12:52:59+00:00\",\"dateModified\":\"2023-07-28T12:52:59+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666\"},\"description\":\"Uma explica\u00e7\u00e3o simples de como realizar uma interpreta\u00e7\u00e3o de teste Kruskal-Wallis em Python.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/#breadcrumb\"},\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Lar\",\"item\":\"https:\/\/statorials.org\/pt\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Como realizar um teste kruskal-wallis em python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/pt\/#website\",\"url\":\"https:\/\/statorials.org\/pt\/\",\"name\":\"Statorials\",\"description\":\"O seu guia para a literacia estat\u00edstica!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/pt\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"pt-PT\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666\",\"name\":\"Dr. benjamim anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\/\/statorials.org\/pt\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/pt\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/pt\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr. benjamim anderson\"},\"description\":\"Ol\u00e1, sou Benjamin, um professor aposentado de estat\u00edstica que se tornou professor dedicado na Statorials. Com vasta experi\u00eancia e conhecimento na \u00e1rea de estat\u00edstica, estou empenhado em compartilhar meu conhecimento para capacitar os alunos por meio de Statorials. Saber mais\",\"sameAs\":[\"https:\/\/statorials.org\/pt\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Como realizar um teste Kruskal-Wallis em Python - Estatologia","description":"Uma explica\u00e7\u00e3o simples de como realizar uma interpreta\u00e7\u00e3o de teste Kruskal-Wallis em 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\/pt\/kruskal-wallis-teste-python\/","og_locale":"pt_PT","og_type":"article","og_title":"Como realizar um teste Kruskal-Wallis em Python - Estatologia","og_description":"Uma explica\u00e7\u00e3o simples de como realizar uma interpreta\u00e7\u00e3o de teste Kruskal-Wallis em Python.","og_url":"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/","og_site_name":"Statorials","article_published_time":"2023-07-28T12:52:59+00:00","author":"Dr. benjamim anderson","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Dr. benjamim anderson","Tempo estimado de leitura":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/","url":"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/","name":"Como realizar um teste Kruskal-Wallis em Python - Estatologia","isPartOf":{"@id":"https:\/\/statorials.org\/pt\/#website"},"datePublished":"2023-07-28T12:52:59+00:00","dateModified":"2023-07-28T12:52:59+00:00","author":{"@id":"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666"},"description":"Uma explica\u00e7\u00e3o simples de como realizar uma interpreta\u00e7\u00e3o de teste Kruskal-Wallis em Python.","breadcrumb":{"@id":"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/#breadcrumb"},"inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/pt\/kruskal-wallis-teste-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Lar","item":"https:\/\/statorials.org\/pt\/"},{"@type":"ListItem","position":2,"name":"Como realizar um teste kruskal-wallis em python"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/pt\/#website","url":"https:\/\/statorials.org\/pt\/","name":"Statorials","description":"O seu guia para a literacia estat\u00edstica!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/pt\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"pt-PT"},{"@type":"Person","@id":"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666","name":"Dr. benjamim anderson","image":{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/statorials.org\/pt\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/pt\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/pt\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr. benjamim anderson"},"description":"Ol\u00e1, sou Benjamin, um professor aposentado de estat\u00edstica que se tornou professor dedicado na Statorials. Com vasta experi\u00eancia e conhecimento na \u00e1rea de estat\u00edstica, estou empenhado em compartilhar meu conhecimento para capacitar os alunos por meio de Statorials. Saber mais","sameAs":["https:\/\/statorials.org\/pt"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/posts\/855","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/comments?post=855"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/posts\/855\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/media?parent=855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/categories?post=855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/tags?post=855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}