{"id":1067,"date":"2023-07-27T19:00:49","date_gmt":"2023-07-27T19:00:49","guid":{"rendered":"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/"},"modified":"2023-07-27T19:00:49","modified_gmt":"2023-07-27T19:00:49","slug":"teste-de-normalidade-multivariada-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/","title":{"rendered":"Como realizar testes multivariados de normalidade em r"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Quando queremos testar se uma \u00fanica vari\u00e1vel \u00e9 normalmente distribu\u00edda ou n\u00e3o, podemos criar um <a href=\"https:\/\/statorials.org\/pt\/alguem-intriga-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">gr\u00e1fico QQ<\/a> para visualizar a distribui\u00e7\u00e3o ou realizar um teste estat\u00edstico formal como um <a href=\"https:\/\/statorials.org\/pt\/teste-de-anderson-cheri-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">teste de Anderson Darling<\/a> ou um <a href=\"https:\/\/Statorials.org\/how-to-conduct-a-jarque-bera-test-in-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">teste de Jarque-Bera<\/a> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">No entanto, quando queremos testar se <em>m\u00faltiplas<\/em> vari\u00e1veis s\u00e3o normalmente distribu\u00eddas como um grupo, precisamos realizar um <strong>teste de normalidade multivariada<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">Este tutorial explica como realizar os seguintes testes de normalidade multivariada para um determinado conjunto de dados em R:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">O teste de Mardia<\/span><\/li>\n<li> <span style=\"color: #000000;\">Teste de energia<\/span><\/li>\n<li> <span style=\"color: #000000;\">Testes multivariados de curtose e assimetria<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\"><strong>Relacionado:<\/strong> Se quisermos identificar valores discrepantes em um contexto multivariado, podemos usar <a href=\"https:\/\/statorials.org\/pt\/distancia-mahalanobis-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">a dist\u00e2ncia de Mahalanobis<\/a> .<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Exemplo: teste de Mardia em R<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\"><strong>O teste de Mardia<\/strong> determina se um grupo de vari\u00e1veis segue ou n\u00e3o uma distribui\u00e7\u00e3o normal multivariada. As hip\u00f3teses nula e alternativa do teste s\u00e3o as seguintes:<\/span><\/p>\n<p> <span style=\"color: #000000;\">H <sub>0<\/sub> (nulo): As vari\u00e1veis seguem uma distribui\u00e7\u00e3o normal multivariada.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><sub>Ha<\/sub> (alternativa): As vari\u00e1veis <em>n\u00e3o seguem<\/em> distribui\u00e7\u00e3o normal multivariada.<\/span><\/p>\n<p> <span style=\"color: #000000;\">O c\u00f3digo a seguir mostra como realizar este teste em R usando o pacote <strong>QuantPsyc<\/strong> :<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\">library<\/span> (QuantPsyc)\n\n<span style=\"color: #008080;\">#create dataset\n<span style=\"color: #000000;\">set.seed(0)\n\ndata &lt;- data.frame(x1 = rnorm(50),\n                   x2 = rnorm(50),\n                   x3 = rnorm(50))<\/span>\n\n#perform Multivariate normality test\n<span style=\"color: #000000;\">mult.norm(data)$ <span style=\"color: #800080;\">mult.test\n\n<\/span><\/span><\/span>Beta-hat kappa p-val\nSkewness 1.630474 13.5872843 0.1926626\nKurtosis 13.895364 -0.7130395 0.4758213\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">A fun\u00e7\u00e3o <strong>mult.norm()<\/strong> testa a normalidade multivariada tanto na assimetria quanto na curtose do conjunto de dados. Como ambos os valores de p n\u00e3o s\u00e3o inferiores a 0,05, n\u00e3o conseguimos rejeitar a hip\u00f3tese nula do teste. N\u00e3o temos evid\u00eancias de que as tr\u00eas vari\u00e1veis do nosso conjunto de dados n\u00e3o sigam uma distribui\u00e7\u00e3o multivariada.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Exemplo: teste de energia em R<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Um <strong>teste<\/strong> <strong>de energia<\/strong> \u00e9 outro teste estat\u00edstico que determina se um grupo de vari\u00e1veis segue ou n\u00e3o uma distribui\u00e7\u00e3o normal multivariada. As hip\u00f3teses nula e alternativa do teste s\u00e3o as seguintes:<\/span><\/p>\n<p> <span style=\"color: #000000;\">H <sub>0<\/sub> (nulo): As vari\u00e1veis seguem uma distribui\u00e7\u00e3o normal multivariada.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><sub>Ha<\/sub> (alternativa): As vari\u00e1veis <em>n\u00e3o seguem<\/em> distribui\u00e7\u00e3o normal multivariada.<\/span><\/p>\n<p> <span style=\"color: #000000;\">O c\u00f3digo a seguir mostra como realizar esse teste em R usando o pacote <b>de energia<\/b> :<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\">library<\/span> (energy)\n\n<span style=\"color: #008080;\">#create dataset\n<span style=\"color: #000000;\">set.seed(0)\n\ndata &lt;- data.frame(x1 = rnorm(50),\n                   x2 = rnorm(50),\n                   x3 = rnorm(50))<\/span>\n\n#perform Multivariate normality test\n<span style=\"color: #000000;\">mvnorm.etest(data, R= <span style=\"color: #008000;\">100<\/span> )\n\n<\/span><\/span>Energy test of multivariate normality: estimated parameters\n\ndata: x, sample size 50, dimension 3, replicates 100\nE-statistic = 0.90923, p-value = 0.31\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">O valor p do teste \u00e9 <strong>0,31<\/strong> . Como este valor n\u00e3o \u00e9 inferior a 0,05, n\u00e3o rejeitamos a hip\u00f3tese nula do teste. N\u00e3o temos evid\u00eancias de que as tr\u00eas vari\u00e1veis do nosso conjunto de dados n\u00e3o sigam uma distribui\u00e7\u00e3o multivariada.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><em><strong>Nota:<\/strong> O argumento R=100 especifica 100 r\u00e9plicas mapeadas por boost a serem usadas ao executar o teste. Para conjuntos de dados com tamanhos amostrais menores, voc\u00ea pode aumentar esse n\u00famero para produzir uma estimativa mais confi\u00e1vel da estat\u00edstica de teste.<\/em><\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Recursos adicionais<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/pt\/alguem-intriga-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Como criar e interpretar um gr\u00e1fico QQ em R<\/a><br \/> <a href=\"https:\/\/statorials.org\/pt\/teste-de-anderson-cheri-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Como realizar um teste de Anderson-Darling em R<\/a><br \/> <a href=\"https:\/\/statorials.org\/pt\/como-fazer-um-teste-jarque-bera-em-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Como realizar um teste Jarque-Bera em R<\/a><br \/><a href=\"https:\/\/statorials.org\/pt\/teste-shapiro-wilk-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Como realizar um teste de Shapiro-Wilk em R<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quando queremos testar se uma \u00fanica vari\u00e1vel \u00e9 normalmente distribu\u00edda ou n\u00e3o, podemos criar um gr\u00e1fico QQ para visualizar a distribui\u00e7\u00e3o ou realizar um teste estat\u00edstico formal como um teste de Anderson Darling ou um teste de Jarque-Bera . No entanto, quando queremos testar se m\u00faltiplas vari\u00e1veis s\u00e3o normalmente distribu\u00eddas como um grupo, precisamos realizar [&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-1067","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 testes multivariados de normalidade em R - Estatoriais<\/title>\n<meta name=\"description\" content=\"Uma explica\u00e7\u00e3o simples de como realizar testes multivariados de normalidade em R, incluindo v\u00e1rios exemplos.\" \/>\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\/teste-de-normalidade-multivariada-r\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Como realizar testes multivariados de normalidade em R - Estatoriais\" \/>\n<meta property=\"og:description\" content=\"Uma explica\u00e7\u00e3o simples de como realizar testes multivariados de normalidade em R, incluindo v\u00e1rios exemplos.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T19:00:49+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=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/\",\"url\":\"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/\",\"name\":\"Como realizar testes multivariados de normalidade em R - Estatoriais\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/pt\/#website\"},\"datePublished\":\"2023-07-27T19:00:49+00:00\",\"dateModified\":\"2023-07-27T19:00:49+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666\"},\"description\":\"Uma explica\u00e7\u00e3o simples de como realizar testes multivariados de normalidade em R, incluindo v\u00e1rios exemplos.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/#breadcrumb\"},\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Lar\",\"item\":\"https:\/\/statorials.org\/pt\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Como realizar testes multivariados de normalidade em r\"}]},{\"@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 testes multivariados de normalidade em R - Estatoriais","description":"Uma explica\u00e7\u00e3o simples de como realizar testes multivariados de normalidade em R, incluindo v\u00e1rios exemplos.","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\/teste-de-normalidade-multivariada-r\/","og_locale":"pt_PT","og_type":"article","og_title":"Como realizar testes multivariados de normalidade em R - Estatoriais","og_description":"Uma explica\u00e7\u00e3o simples de como realizar testes multivariados de normalidade em R, incluindo v\u00e1rios exemplos.","og_url":"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/","og_site_name":"Statorials","article_published_time":"2023-07-27T19:00:49+00:00","author":"Dr. benjamim anderson","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Dr. benjamim anderson","Tempo estimado de leitura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/","url":"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/","name":"Como realizar testes multivariados de normalidade em R - Estatoriais","isPartOf":{"@id":"https:\/\/statorials.org\/pt\/#website"},"datePublished":"2023-07-27T19:00:49+00:00","dateModified":"2023-07-27T19:00:49+00:00","author":{"@id":"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666"},"description":"Uma explica\u00e7\u00e3o simples de como realizar testes multivariados de normalidade em R, incluindo v\u00e1rios exemplos.","breadcrumb":{"@id":"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/#breadcrumb"},"inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/pt\/teste-de-normalidade-multivariada-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Lar","item":"https:\/\/statorials.org\/pt\/"},{"@type":"ListItem","position":2,"name":"Como realizar testes multivariados de normalidade em r"}]},{"@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\/1067","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=1067"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/posts\/1067\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/media?parent=1067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/categories?post=1067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/tags?post=1067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}