<?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 percentage by gender of wages below each decile in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/percentage-by-gender-of-wages-below-each-decile/m-p/793451#M254335</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to calculate the percentage of men and women with a salary below each decile (&amp;lt;p10, &amp;lt;p20...). So I have a binary variable gender, a variable for salaries (from 1 to 20'000).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to separate my database into 10 equal parts with &lt;STRONG&gt;proc rank&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc rank data=database groups=10 descending out=ranked;
var wages;
ranks decile;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I sorted it by gender and did a proc freq for the first decile (the idea is to repeat this for each decile).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sort data=ranked
		out=ranked_sort;
	by sex;
run;
 
proc freq data= ranked_sort ;

where decile = 9 ;	* p10 ;
	
table wages*sex ;	
&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I find a total of % for men and for women but I also have the details for each wage (1-3000) in the decile. I would like to have only the total for the decile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have an idea how to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance, regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jan 2022 11:14:00 GMT</pubDate>
    <dc:creator>jo_</dc:creator>
    <dc:date>2022-01-31T11:14:00Z</dc:date>
    <item>
      <title>percentage by gender of wages below each decile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/percentage-by-gender-of-wages-below-each-decile/m-p/793451#M254335</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to calculate the percentage of men and women with a salary below each decile (&amp;lt;p10, &amp;lt;p20...). So I have a binary variable gender, a variable for salaries (from 1 to 20'000).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to separate my database into 10 equal parts with &lt;STRONG&gt;proc rank&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc rank data=database groups=10 descending out=ranked;
var wages;
ranks decile;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I sorted it by gender and did a proc freq for the first decile (the idea is to repeat this for each decile).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sort data=ranked
		out=ranked_sort;
	by sex;
run;
 
proc freq data= ranked_sort ;

where decile = 9 ;	* p10 ;
	
table wages*sex ;	
&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I find a total of % for men and for women but I also have the details for each wage (1-3000) in the decile. I would like to have only the total for the decile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have an idea how to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance, regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 11:14:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/percentage-by-gender-of-wages-below-each-decile/m-p/793451#M254335</guid>
      <dc:creator>jo_</dc:creator>
      <dc:date>2022-01-31T11:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: percentage by gender of wages below each decile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/percentage-by-gender-of-wages-below-each-decile/m-p/793452#M254336</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I would like to calculate the percentage of men and women with a salary below each decile (&amp;lt;p10, &amp;lt;p20...). So I have a binary variable gender, a variable for salaries (from 1 to 20'000).&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Isn't the percent less than p10 equal to 10 percent? Isn't the percent less than p20 equal to 20 percent?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 11:39:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/percentage-by-gender-of-wages-below-each-decile/m-p/793452#M254336</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-01-31T11:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: percentage by gender of wages below each decile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/percentage-by-gender-of-wages-below-each-decile/m-p/793453#M254337</link>
      <description>&lt;P&gt;If there are no tied values, then, by definition,&amp;nbsp; you will get of employees 10% of values below the first decile, 20% below the second decile, and so forth. So, I guess you are trying to look at whether males/females differ in their proportions?&amp;nbsp; Because another option is to look at the empirical distribution curves separately for males and females. If the two curves differ, that tells you whether the distribution of salaries differs between genders:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
set sashelp.heart;
keep Sex Cholesterol;
run;

proc univariate data=Have;
class Sex;
var Cholesterol;
cdfplot Cholesterol;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But if you want to use the PROC RANK and PROC FREQ idea, see if this helps:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc rank data=Have groups=10 descending out=ranked;
   var Wages;
   ranks decile;
run;
 
proc freq data= ranked;
table sex*decile / list out=ListOut;	
run;

proc means data=ListOut Sum;
class Sex;
var Count;
run;

/*
Female Sum=2873
Male   Sum=2336
*/
data Want;
set ListOut;
if Sex='Female' then Prop = Count / 2873;
else Prop = Count / 2336;
run;

proc print data=Want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Jan 2022 11:49:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/percentage-by-gender-of-wages-below-each-decile/m-p/793453#M254337</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-01-31T11:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: percentage by gender of wages below each decile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/percentage-by-gender-of-wages-below-each-decile/m-p/793459#M254341</link>
      <description>Thanks for the comment. Of course you are right but I meant I am trying to see wether the proportions of men and women differ in each decile?&lt;BR /&gt;For p10: X% of men and X% of women (=100%).</description>
      <pubDate>Mon, 31 Jan 2022 12:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/percentage-by-gender-of-wages-below-each-decile/m-p/793459#M254341</guid>
      <dc:creator>jo_</dc:creator>
      <dc:date>2022-01-31T12:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: percentage by gender of wages below each decile</title>
      <link>https://communities.sas.com/t5/SAS-Programming/percentage-by-gender-of-wages-below-each-decile/m-p/793461#M254343</link>
      <description>Thank you Rick_SAS for the solution.&lt;BR /&gt;&lt;BR /&gt;As you supposed, I am trying to look at whether males/females differ in their proportions. The second part of your answer with PROC RANK and PROC FREQ is exaclty what I need.&lt;BR /&gt;&lt;BR /&gt;Thank you for help.&lt;BR /&gt;Regards,&lt;BR /&gt;Jo</description>
      <pubDate>Mon, 31 Jan 2022 12:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/percentage-by-gender-of-wages-below-each-decile/m-p/793461#M254343</guid>
      <dc:creator>jo_</dc:creator>
      <dc:date>2022-01-31T12:31:25Z</dc:date>
    </item>
  </channel>
</rss>

