{"id":2617,"date":"2023-07-21T11:58:27","date_gmt":"2023-07-21T11:58:27","guid":{"rendered":"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/"},"modified":"2023-07-21T11:58:27","modified_gmt":"2023-07-21T11:58:27","slug":"grafico-a-barre-sas","status":"publish","type":"post","link":"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/","title":{"rendered":"Come creare grafici a barre in sas (3 esempi)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u00c8 possibile utilizzare i seguenti metodi per creare diversi tipi di grafici a barre in SAS:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Metodo 1: crea un grafico a barre<\/strong><\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #800080;\">proc sgplot <span style=\"color: #000000;\"><span style=\"color: #3366ff;\">data<\/span> = my_data;\n    <span style=\"color: #3366ff;\">vbar<\/span> variable1;\n<span style=\"color: #800080;\">run<\/span> ;\n<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><strong>Metodo 2: creare un grafico a barre in pila<\/strong><\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #800080;\">proc sgplot <span style=\"color: #000000;\"><span style=\"color: #3366ff;\">data<\/span> = my_data;\n    <span style=\"color: #3366ff;\">vbar<\/span> variable1 \/ <span style=\"color: #3366ff;\">group<\/span> = variable2;\n<span style=\"color: #800080;\">run<\/span> ;<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><strong>Metodo 3: creare un grafico a barre raggruppato<\/strong><\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #800080;\">proc sgplot <span style=\"color: #000000;\"><span style=\"color: #3366ff;\">data<\/span> = my_data;\n    <span style=\"color: #3366ff;\">vbar<\/span> variable1 \/ <span style=\"color: #3366ff;\">group<\/span> = variable2 <span style=\"color: #3366ff;\">groupdisplay<\/span> = cluster;\n<span style=\"color: #800080;\">run<\/span> ;<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Gli esempi seguenti mostrano come utilizzare ciascun metodo con il seguente set di dati in SAS:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">\/*create dataset*\/\n<span style=\"color: #000000;\"><span style=\"color: #800080;\">data<\/span> my_data;\n    <span style=\"color: #3366ff;\">input<\/span> team $position $points;\n    <span style=\"color: #3366ff;\">datalines<\/span> ;\nA Guard 8\nA Guard 6\nA Guard 6\nA Forward 9\nA Forward 14\nA Forward 11\nB Guard 10\nB Guard 9\nB Guard 5\nB Forward 7\nC Guard 10\nC Forward 6\nC Forward 8\n;\n<span style=\"color: #800080;\">run<\/span> ;<\/span><\/span>\n\n<span style=\"color: #008000;\">\/*view dataset*\/\n<\/span><span style=\"color: #000000;\"><span style=\"color: #800080;\">proc print<\/span> <span style=\"color: #3366ff;\">data<\/span> =my_data;<\/span><\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-23087 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/barre1-1.jpg\" alt=\"\" width=\"218\" height=\"350\" srcset=\"\" sizes=\"\"><\/p>\n<h3> <span style=\"color: #000000;\"><b>Esempio 1: <strong>creare un grafico a barre<\/strong><\/b><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Il codice seguente mostra come creare un grafico a barre per visualizzare la frequenza di spostamento:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #800080;\"><span style=\"color: #000000;\"><span style=\"color: #008000;\">\/*create bar chart to visualize frequency of teams*\/\n<\/span><span style=\"color: #3366ff;\">title<\/span> \" <span style=\"color: #ff0000;\">Bar Chart of Team Frequency<\/span> \";<\/span>\nproc sgplot <span style=\"color: #000000;\"><span style=\"color: #3366ff;\">data<\/span> = my_data;\n    <span style=\"color: #3366ff;\">vbar<\/span> team;\n<span style=\"color: #800080;\">run<\/span> ;<\/span><\/span><\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-23088\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/barre2-1.jpg\" alt=\"grafico a barre in SAS\" width=\"597\" height=\"449\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">Se invece desideri un grafico a barre orizzontali, utilizza semplicemente l&#8217;opzione <strong>hbar<\/strong> :<\/span><\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #800080;\"><span style=\"color: #000000;\"><span style=\"color: #008000;\">\/*create horizontal bar chart to visualize frequency of teams*\/\n<\/span><span style=\"color: #3366ff;\">title<\/span> \" <span style=\"color: #ff0000;\">Bar Chart of Team Frequency<\/span> \";<\/span>\nproc sgplot <span style=\"color: #000000;\"><span style=\"color: #3366ff;\">data<\/span> = my_data;\n    <span style=\"color: #3366ff;\">hbar<\/span> team;\nrun;<\/span><\/span><\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-23089 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/barre3.jpg\" alt=\"grafico a barre orizzontali in SAS\" width=\"589\" height=\"442\" srcset=\"\" sizes=\"\"><\/p>\n<h3> <span style=\"color: #000000;\"><b>Esempio 2: <strong>creare un grafico a barre in pila<\/strong><\/b><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Il codice seguente mostra come creare un grafico a barre in pila per visualizzare la frequenza <strong>della squadra<\/strong> e <strong>della posizione<\/strong> :<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #800080;\"><span style=\"color: #008000;\">\/*create stacked bar chart*\/<\/span>\n<span style=\"color: #000000;\">title \" <span style=\"color: #ff0000;\">Stacked Bar Chart of Team &amp; Position<\/span> \";<\/span>\nproc sgplot <span style=\"color: #000000;\"><span style=\"color: #3366ff;\">data<\/span> = my_data;\n    <span style=\"color: #3366ff;\">vbar<\/span> team \/ <span style=\"color: #3366ff;\">group<\/span> = position;\n<span style=\"color: #800080;\">run<\/span> ;<\/span><\/span><\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-23090 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/barre4.jpg\" alt=\"grafico a barre in pila in SAS\" width=\"587\" height=\"440\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Questo grafico ci consente di visualizzare la frequenza di ciascuna squadra cos\u00ec come la frequenza delle posizioni all&#8217;interno di ciascuna squadra.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Esempio 3: creare un grafico a barre raggruppato<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Il codice seguente mostra come creare un grafico a barre raggruppate per visualizzare la frequenza <strong>della squadra<\/strong> e <strong>della posizione<\/strong> :<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #800080;\"><span style=\"color: #008000;\">\/*create clustered bar chart*\/<\/span>\n<span style=\"color: #000000;\">title \" <span style=\"color: #ff0000;\">Clustered Bar Chart of Team &amp; Position<\/span> \";<\/span>\nproc sgplot <span style=\"color: #000000;\"><span style=\"color: #3366ff;\">data<\/span> = my_data;\n    <span style=\"color: #3366ff;\">vbar<\/span> team \/ <span style=\"color: #3366ff;\">group<\/span> = position <span style=\"color: #3366ff;\">groupdisplay<\/span> = cluster;\nrun;<\/span><\/span><\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-23091 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/barre5.jpg\" alt=\"grafico a barre raggruppate in SAS\" width=\"586\" height=\"438\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Questo grafico a barre visualizza le stesse informazioni del grafico a barre precedente, tranne per il fatto che le barre sono &#8220;raggruppate&#8221; insieme anzich\u00e9 impilate una sopra l&#8217;altra.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Risorse addizionali<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">I seguenti tutorial spiegano come creare altri grafici in SAS:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/it\/camera-di-equilibrio-a-traccia-lineare\/\" target=\"_blank\" rel=\"noopener\">Come creare grafici a linee in SAS<\/a><br \/> <a href=\"https:\/\/statorials.org\/it\/istogramma-della-camera-di-equilibrio\/\" target=\"_blank\" rel=\"noopener\">Come creare istogrammi in SAS<\/a><br \/> <a href=\"https:\/\/statorials.org\/it\/camera-di-equilibrio-dei-baffi-della-scatola-per-gruppo\/\" target=\"_blank\" rel=\"noopener\">Come creare boxplot per gruppo in SAS<\/a><br \/> <a href=\"https:\/\/statorials.org\/it\/nuvola-di-punti-con-retta-di-regressione-sas\/\" target=\"_blank\" rel=\"noopener\">Come creare un grafico a dispersione con una linea di regressione in SAS<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00c8 possibile utilizzare i seguenti metodi per creare diversi tipi di grafici a barre in SAS: Metodo 1: crea un grafico a barre proc sgplot data = my_data; vbar variable1; run ; Metodo 2: creare un grafico a barre in pila proc sgplot data = my_data; vbar variable1 \/ group = variable2; run ; Metodo [&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":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Come creare grafici a barre in SAS (3 esempi) - Statorials<\/title>\n<meta name=\"description\" content=\"Questo tutorial spiega come creare grafici a barre in SAS, con diversi esempi.\" \/>\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\/it\/grafico-a-barre-sas\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Come creare grafici a barre in SAS (3 esempi) - Statorials\" \/>\n<meta property=\"og:description\" content=\"Questo tutorial spiega come creare grafici a barre in SAS, con diversi esempi.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-21T11:58:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/barre1-1.jpg\" \/>\n<meta name=\"author\" content=\"Benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/\",\"url\":\"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/\",\"name\":\"Come creare grafici a barre in SAS (3 esempi) - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/it\/#website\"},\"datePublished\":\"2023-07-21T11:58:27+00:00\",\"dateModified\":\"2023-07-21T11:58:27+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae\"},\"description\":\"Questo tutorial spiega come creare grafici a barre in SAS, con diversi esempi.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Casa\",\"item\":\"https:\/\/statorials.org\/it\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Come creare grafici a barre in sas (3 esempi)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/it\/#website\",\"url\":\"https:\/\/statorials.org\/it\/\",\"name\":\"Statorials\",\"description\":\"La tua guida all&#039;alfabetizzazione statistica!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/it\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae\",\"name\":\"Benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Benjamin anderson\"},\"description\":\"Ciao, sono Benjamin, un professore di statistica in pensione diventato insegnante dedicato di Statorials. Con una vasta esperienza e competenza nel campo della statistica, sono ansioso di condividere le mie conoscenze per potenziare gli studenti attraverso Statorials. Scopri di pi\u00f9\",\"sameAs\":[\"https:\/\/statorials.org\/it\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Come creare grafici a barre in SAS (3 esempi) - Statorials","description":"Questo tutorial spiega come creare grafici a barre in SAS, con diversi esempi.","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\/it\/grafico-a-barre-sas\/","og_locale":"it_IT","og_type":"article","og_title":"Come creare grafici a barre in SAS (3 esempi) - Statorials","og_description":"Questo tutorial spiega come creare grafici a barre in SAS, con diversi esempi.","og_url":"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/","og_site_name":"Statorials","article_published_time":"2023-07-21T11:58:27+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/barre1-1.jpg"}],"author":"Benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Benjamin anderson","Est. reading time":"2 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/","url":"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/","name":"Come creare grafici a barre in SAS (3 esempi) - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/it\/#website"},"datePublished":"2023-07-21T11:58:27+00:00","dateModified":"2023-07-21T11:58:27+00:00","author":{"@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae"},"description":"Questo tutorial spiega come creare grafici a barre in SAS, con diversi esempi.","breadcrumb":{"@id":"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/it\/grafico-a-barre-sas\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/it\/grafico-a-barre-sas\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Casa","item":"https:\/\/statorials.org\/it\/"},{"@type":"ListItem","position":2,"name":"Come creare grafici a barre in sas (3 esempi)"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/it\/#website","url":"https:\/\/statorials.org\/it\/","name":"Statorials","description":"La tua guida all&#039;alfabetizzazione statistica!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/it\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"it-IT"},{"@type":"Person","@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae","name":"Benjamin anderson","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Benjamin anderson"},"description":"Ciao, sono Benjamin, un professore di statistica in pensione diventato insegnante dedicato di Statorials. Con una vasta esperienza e competenza nel campo della statistica, sono ansioso di condividere le mie conoscenze per potenziare gli studenti attraverso Statorials. Scopri di pi\u00f9","sameAs":["https:\/\/statorials.org\/it"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts\/2617"}],"collection":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/comments?post=2617"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts\/2617\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/media?parent=2617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/categories?post=2617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/tags?post=2617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}