<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pie Charts with subgroups in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Pie-Charts-with-subgroups/m-p/839564#M331950</link>
    <description>&lt;P&gt;Don't you want to sum the number of subjects?&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 02:49:17 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2022-10-20T02:49:17Z</dc:date>
    <item>
      <title>Pie Charts with subgroups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pie-Charts-with-subgroups/m-p/839362#M331894</link>
      <description>&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;suppose I have a dataset that looks like this, and I wish to create a pie chart with sub categories&amp;nbsp; as shown below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value $ level "1"="level1"
             "2"="level2"
			 "3"="level3"
			 "5"="level5"
			 "6"="level6"
			 "7"="level7"
;
run;
&lt;BR /&gt;&lt;BR /&gt;data have;
	infile datalines;
	format level $level.;
	input answers $4. level $2.  num_of_subjects  ;
	datalines;
No  1 100
yes 1 50
No  2 80
yes 2 150
yes 3 16
No  3  2
yes 5  45
No  6  180
yes 6  200
No  7   55
;
run;

legend1 label=none
        shape=bar(4,1.5)
        position=(top left)
        offset=(5,)
        across=2
        mode=share;

proc gchart data=have ;
    pie level / detail=answers
	            other=0
				midpoints= 'level1' 'level1' 'level2' 'level2' 'level3' 'level3' 'level5' 'level6' 'level6' 'level7' 
                radius=35
                angle=90
                slice= none
				noheading
                coutline=black
				legend=legend1;
		
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;how do I include the variable num_of_subjects in the code to get the exact proportion of each slices. I also wish to include the value of num_of_subjects in each subgroup/slice. Using SUMVAR sums up the variables and that is not what I want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 13:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pie-Charts-with-subgroups/m-p/839362#M331894</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2022-10-19T13:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Charts with subgroups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pie-Charts-with-subgroups/m-p/839564#M331950</link>
      <description>&lt;P&gt;Don't you want to sum the number of subjects?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 02:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pie-Charts-with-subgroups/m-p/839564#M331950</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2022-10-20T02:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Charts with subgroups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pie-Charts-with-subgroups/m-p/839583#M331956</link>
      <description>&lt;P&gt;Thanks, I realised I actually need to use SUMVAR. So I finally got it working, thanks&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 07:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pie-Charts-with-subgroups/m-p/839583#M331956</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2022-10-20T07:16:21Z</dc:date>
    </item>
  </channel>
</rss>

