{"id":671,"date":"2023-07-29T03:34:36","date_gmt":"2023-07-29T03:34:36","guid":{"rendered":"https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/"},"modified":"2023-07-29T03:34:36","modified_gmt":"2023-07-29T03:34:36","slug":"tracar-a-distribuicao-weibull-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/","title":{"rendered":"Como tra\u00e7ar uma distribui\u00e7\u00e3o weibull em r"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Para tra\u00e7ar a fun\u00e7\u00e3o de densidade de probabilidade para uma distribui\u00e7\u00e3o Weibull em R, podemos usar as seguintes fun\u00e7\u00f5es:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>dweibull(x, shape, scale = 1)<\/strong> para criar a fun\u00e7\u00e3o de densidade de probabilidade.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>curve(function, from = NULL, to = NULL)<\/strong> para tra\u00e7ar a fun\u00e7\u00e3o de densidade de probabilidade.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Para tra\u00e7ar a fun\u00e7\u00e3o de densidade de probabilidade, precisamos especificar o valor do par\u00e2metro de <strong>forma<\/strong> e <strong>escala<\/strong> na fun\u00e7\u00e3o <strong>dweibull<\/strong> , bem como os valores <strong>de<\/strong> e <strong>para<\/strong> na fun\u00e7\u00e3o <strong>curve()<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">Por exemplo, o c\u00f3digo a seguir ilustra como tra\u00e7ar uma fun\u00e7\u00e3o de densidade de probabilidade para uma distribui\u00e7\u00e3o Weibull com par\u00e2metros forma = 2 e escala = 1 onde o eixo x do gr\u00e1fico vai de 0 a 4:<\/span> <\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong>curve(dweibull(x, shape=2, scale = 1), from=0, to=4)\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-6464 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/weibullr1.png\" alt=\"Tra\u00e7ando uma distribui\u00e7\u00e3o Weibull em R\" width=\"417\" height=\"381\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Podemos adicionar um t\u00edtulo, alterar o r\u00f3tulo do eixo Y, aumentar a largura da linha e at\u00e9 mesmo alterar a cor da linha para tornar o gr\u00e1fico mais esteticamente agrad\u00e1vel:<\/span> <\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong>curve(dweibull(x, shape=2, scale = 1), from=0, to=4, \n    main = 'Weibull Distribution (shape = 2, scale = 1)', <span style=\"color: #008080;\">#add title<\/span>\n    ylab = 'Density', <span style=\"color: #008080;\">#change y-axis label<\/span>\n    lwd = 2, <span style=\"color: #008080;\">#increase line width to 2<\/span>\n    col = 'steelblue') <span style=\"color: #008080;\">#change line color to steelblue<\/span> \n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-6465 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/weibullr2.png\" alt=\"Gr\u00e1fico de distribui\u00e7\u00e3o Weibull em R\" width=\"420\" height=\"422\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Tamb\u00e9m podemos adicionar v\u00e1rias curvas ao gr\u00e1fico para comparar distribui\u00e7\u00f5es Weibull com diferentes par\u00e2metros de forma e escala:<\/span> <\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong>curve(dweibull(x, shape=2, scale = 1), from=0, to=4, col='red')\ncurve(dweibull(x, shape=1.5, scale = 1), from=0, to=4, col='blue', add=TRUE)\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-6466 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/weibullr3.png\" alt=\"V\u00e1rios gr\u00e1ficos de distribui\u00e7\u00e3o Weibull em R\" width=\"419\" height=\"391\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Podemos adicionar uma legenda ao gr\u00e1fico usando a fun\u00e7\u00e3o <strong>legend()<\/strong> , que assume a seguinte sintaxe:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>legenda(x, y=NULL, legenda, preenchimento, col, bg, lty, cex)<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Ouro:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>x, y:<\/strong> as coordenadas xey usadas para posicionar a legenda<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>legenda:<\/strong> o texto a ser colocado na legenda<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>fill:<\/strong> preenche a cor dentro da legenda<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>col:<\/strong> a lista de cores a serem usadas nas linhas dentro da legenda<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>bg:<\/strong> a cor de fundo da legenda<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>lty:<\/strong> estilo de linha<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>cex:<\/strong> tamanho do texto na legenda<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Em nosso exemplo usaremos a seguinte sintaxe para criar uma legenda:<\/span> <\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create density plots<\/span>\ncurve(dweibull(x, shape=2, scale = 1), from=0, to=4, col='red')\ncurve(dweibull(x, shape=1.5, scale = 1), from=0, to=4, col='blue', add=TRUE)\n\n<span style=\"color: #008080;\">#add legend<\/span>\nlegend(2, .7, legend=c(\"shape=2, scale=1\", \"shape=1.5, scale=1\"),\n       col=c(\"red\", \"blue\"), lty=1, cex=1.2)<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-6467 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/weibullr4.png\" alt=\"Gr\u00e1fico de distribui\u00e7\u00e3o Weibull em R com legenda\" width=\"421\" height=\"411\" srcset=\"\" sizes=\"auto, \"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Para tra\u00e7ar a fun\u00e7\u00e3o de densidade de probabilidade para uma distribui\u00e7\u00e3o Weibull em R, podemos usar as seguintes fun\u00e7\u00f5es: dweibull(x, shape, scale = 1) para criar a fun\u00e7\u00e3o de densidade de probabilidade. curve(function, from = NULL, to = NULL) para tra\u00e7ar a fun\u00e7\u00e3o de densidade de probabilidade. Para tra\u00e7ar a fun\u00e7\u00e3o de densidade de probabilidade, [&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-671","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 tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R - Statorials<\/title>\n<meta name=\"description\" content=\"Uma explica\u00e7\u00e3o simples de como tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R.\" \/>\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\/tracar-a-distribuicao-weibull-r\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Como tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R - Statorials\" \/>\n<meta property=\"og:description\" content=\"Uma explica\u00e7\u00e3o simples de como tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-29T03:34:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/weibullr1.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\/tracar-a-distribuicao-weibull-r\/\",\"url\":\"https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/\",\"name\":\"Como tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/pt\/#website\"},\"datePublished\":\"2023-07-29T03:34:36+00:00\",\"dateModified\":\"2023-07-29T03:34:36+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666\"},\"description\":\"Uma explica\u00e7\u00e3o simples de como tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/#breadcrumb\"},\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Lar\",\"item\":\"https:\/\/statorials.org\/pt\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Como tra\u00e7ar uma distribui\u00e7\u00e3o weibull 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 tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R - Statorials","description":"Uma explica\u00e7\u00e3o simples de como tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R.","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\/tracar-a-distribuicao-weibull-r\/","og_locale":"pt_PT","og_type":"article","og_title":"Como tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R - Statorials","og_description":"Uma explica\u00e7\u00e3o simples de como tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R.","og_url":"https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/","og_site_name":"Statorials","article_published_time":"2023-07-29T03:34:36+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/weibullr1.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\/tracar-a-distribuicao-weibull-r\/","url":"https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/","name":"Como tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/pt\/#website"},"datePublished":"2023-07-29T03:34:36+00:00","dateModified":"2023-07-29T03:34:36+00:00","author":{"@id":"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666"},"description":"Uma explica\u00e7\u00e3o simples de como tra\u00e7ar uma distribui\u00e7\u00e3o Weibull em R.","breadcrumb":{"@id":"https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/#breadcrumb"},"inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/pt\/tracar-a-distribuicao-weibull-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Lar","item":"https:\/\/statorials.org\/pt\/"},{"@type":"ListItem","position":2,"name":"Como tra\u00e7ar uma distribui\u00e7\u00e3o weibull 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\/671","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=671"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/posts\/671\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/media?parent=671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/categories?post=671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/tags?post=671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}