{"id":1760,"date":"2023-07-25T02:31:46","date_gmt":"2023-07-25T02:31:46","guid":{"rendered":"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/"},"modified":"2023-07-25T02:31:46","modified_gmt":"2023-07-25T02:31:46","slug":"teste-dickey-fuller-em-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/","title":{"rendered":"Teste dickey-fuller aumentado em r (com exemplo)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Uma s\u00e9rie temporal \u00e9 dita \u201cestacion\u00e1ria\u201d se n\u00e3o tem tend\u00eancia, apresenta uma vari\u00e2ncia constante ao longo do tempo e tem uma estrutura de autocorrela\u00e7\u00e3o constante ao longo do tempo.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Uma maneira de testar se uma s\u00e9rie temporal \u00e9 estacion\u00e1ria \u00e9 realizar um <strong>teste Dickey-Fuller aumentado<\/strong> , que usa as seguintes hip\u00f3teses nulas e alternativas:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>H <sub>0<\/sub> :<\/strong> A s\u00e9rie temporal \u00e9 n\u00e3o estacion\u00e1ria. Em outras palavras, sua estrutura depende do tempo e sua varia\u00e7\u00e3o n\u00e3o \u00e9 constante ao longo do tempo.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong><sub>HA<\/sub> :<\/strong> A s\u00e9rie temporal \u00e9 estacion\u00e1ria.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Se o <a href=\"https:\/\/statorials.org\/pt\/p-valores-significancia-estatistica\/\" target=\"_blank\" rel=\"noopener\">valor p<\/a> do teste estiver abaixo de um certo n\u00edvel de signific\u00e2ncia (por exemplo, \u03b1 = 0,05), ent\u00e3o podemos rejeitar a hip\u00f3tese nula e concluir que a s\u00e9rie temporal \u00e9 estacion\u00e1ria.<\/span><\/p>\n<p> <span style=\"color: #000000;\">O exemplo passo a passo a seguir mostra como realizar um teste Dickey-Fuller aumentado em R para uma determinada s\u00e9rie temporal.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Exemplo: teste Dickey-Fuller aumentado em R<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Suponha que temos os seguintes dados de s\u00e9rie temporal em R:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>data &lt;- c(3, 4, 4, 5, 6, 7, 6, 6, 7, 8, 9, 12, 10)<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Antes de realizar um teste Dickey-Fuller aumentado nos dados, podemos criar um gr\u00e1fico r\u00e1pido para visualizar os dados:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>plot(data, type=' <span style=\"color: #008000;\">l<\/span> ')\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-17239 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/adf2.png\" alt=\"\" width=\"407\" height=\"374\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Para realizar um teste Dickey-Fuller aumentado, podemos usar a fun\u00e7\u00e3o <a href=\"https:\/\/www.rdocumentation.org\/packages\/aTSA\/versions\/3.1.2\/topics\/adf.test\" target=\"_blank\" rel=\"noopener\">adf.test()<\/a> da biblioteca <b>tseries<\/b> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">O c\u00f3digo a seguir mostra como usar esta fun\u00e7\u00e3o:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\">library<\/span> (tseries)\n\n<span style=\"color: #008080;\">#perform augmented Dickey-Fuller test<\/span> \nadf.test(data)\n\n\tAugmented Dickey-Fuller Test\n\ndata:data\nDickey-Fuller = -2.2048, Lag order = 2, p-value = 0.4943\nalternative hypothesis: stationary\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Veja como interpretar os valores mais importantes do resultado:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">Estat\u00edstica de teste: <strong>-2,2048<\/strong><\/span><\/li>\n<li> <span style=\"color: #000000;\">Valor P: <strong>0,4943<\/strong><\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Como o valor p n\u00e3o \u00e9 inferior a 0,05, n\u00e3o rejeitamos a hip\u00f3tese nula.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Isso significa que a s\u00e9rie temporal n\u00e3o \u00e9 estacion\u00e1ria. Ou seja, sua estrutura depende do tempo e sua varia\u00e7\u00e3o n\u00e3o \u00e9 constante ao longo do tempo.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Recursos adicionais<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Os tutoriais a seguir explicam como realizar outras tarefas comuns em R:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/pt\/teste-de-tendencia-mann-kendall-r\/\" target=\"_blank\" rel=\"noopener\">Como realizar um teste de tend\u00eancia Mann-Kendall em R<\/a><br \/> <a href=\"https:\/\/statorials.org\/pt\/tracar-series-temporais-em-r\/\" target=\"_blank\" rel=\"noopener\">Como tra\u00e7ar uma s\u00e9rie temporal em R<\/a><br \/> <a href=\"https:\/\/statorials.org\/pt\/dados-de-tendencia\/\" target=\"_blank\" rel=\"noopener\">Como reduzir tend\u00eancias de dados<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Uma s\u00e9rie temporal \u00e9 dita \u201cestacion\u00e1ria\u201d se n\u00e3o tem tend\u00eancia, apresenta uma vari\u00e2ncia constante ao longo do tempo e tem uma estrutura de autocorrela\u00e7\u00e3o constante ao longo do tempo. Uma maneira de testar se uma s\u00e9rie temporal \u00e9 estacion\u00e1ria \u00e9 realizar um teste Dickey-Fuller aumentado , que usa as seguintes hip\u00f3teses nulas e alternativas: H [&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-1760","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>Teste Dickey-Fuller aumentado em R (com exemplo) - Estatologia<\/title>\n<meta name=\"description\" content=\"Este tutorial explica como realizar um teste Dickey-Fuller aumentado em R, incluindo um exemplo passo a passo.\" \/>\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-dickey-fuller-em-r\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Teste Dickey-Fuller aumentado em R (com exemplo) - Estatologia\" \/>\n<meta property=\"og:description\" content=\"Este tutorial explica como realizar um teste Dickey-Fuller aumentado em R, incluindo um exemplo passo a passo.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-25T02:31:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/adf2.png\" \/>\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=\"2 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/\",\"url\":\"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/\",\"name\":\"Teste Dickey-Fuller aumentado em R (com exemplo) - Estatologia\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/pt\/#website\"},\"datePublished\":\"2023-07-25T02:31:46+00:00\",\"dateModified\":\"2023-07-25T02:31:46+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666\"},\"description\":\"Este tutorial explica como realizar um teste Dickey-Fuller aumentado em R, incluindo um exemplo passo a passo.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/#breadcrumb\"},\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Lar\",\"item\":\"https:\/\/statorials.org\/pt\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Teste dickey-fuller aumentado em r (com exemplo)\"}]},{\"@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":"Teste Dickey-Fuller aumentado em R (com exemplo) - Estatologia","description":"Este tutorial explica como realizar um teste Dickey-Fuller aumentado em R, incluindo um exemplo passo a passo.","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-dickey-fuller-em-r\/","og_locale":"pt_PT","og_type":"article","og_title":"Teste Dickey-Fuller aumentado em R (com exemplo) - Estatologia","og_description":"Este tutorial explica como realizar um teste Dickey-Fuller aumentado em R, incluindo um exemplo passo a passo.","og_url":"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/","og_site_name":"Statorials","article_published_time":"2023-07-25T02:31:46+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/adf2.png"}],"author":"Dr. benjamim anderson","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Dr. benjamim anderson","Tempo estimado de leitura":"2 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/","url":"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/","name":"Teste Dickey-Fuller aumentado em R (com exemplo) - Estatologia","isPartOf":{"@id":"https:\/\/statorials.org\/pt\/#website"},"datePublished":"2023-07-25T02:31:46+00:00","dateModified":"2023-07-25T02:31:46+00:00","author":{"@id":"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666"},"description":"Este tutorial explica como realizar um teste Dickey-Fuller aumentado em R, incluindo um exemplo passo a passo.","breadcrumb":{"@id":"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/#breadcrumb"},"inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/pt\/teste-dickey-fuller-em-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Lar","item":"https:\/\/statorials.org\/pt\/"},{"@type":"ListItem","position":2,"name":"Teste dickey-fuller aumentado em r (com exemplo)"}]},{"@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\/1760","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=1760"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/posts\/1760\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/media?parent=1760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/categories?post=1760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/tags?post=1760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}