<?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: how to calculate number of women in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555650#M74723</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252600"&gt;@Radwan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It is not what i want&lt;BR /&gt;because this code count the number of female director in total. I need to count the number of female directors in each firm not in whole sample&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;My example was posted before you posted data and is an example of a technique.&amp;nbsp; If you haven't use PROC SUMMARY before I suggest you consult the documentation.&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2019 16:26:58 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2019-05-02T16:26:58Z</dc:date>
    <item>
      <title>how to calculate number of women</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/554571#M74678</link>
      <description>&lt;P&gt;Hello everyone.&lt;/P&gt;&lt;P&gt;my question today is How can I calculate the number of women from dummy variable?&lt;/P&gt;&lt;P&gt;I will explain my situation&lt;/P&gt;&lt;P&gt;I have a variable its name gender ( which means 1 female 0 male) this variable contain all firms and many years , as&amp;nbsp; well as there are some firms have more than one woman director on the board that appear as repetition observations .&lt;/P&gt;&lt;P&gt;so i want to calculate the number of women in each firm by each year and the results comes out as new variable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please help me i need a code for doing so because it take too much time&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Apr 2019 11:03:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/554571#M74678</guid>
      <dc:creator>Radwan</dc:creator>
      <dc:date>2019-04-28T11:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate number of women</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/554572#M74679</link>
      <description>&lt;P&gt;Please show us a representative portion of your data, following these instructions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Apr 2019 11:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/554572#M74679</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-28T11:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate number of women</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/554574#M74680</link>
      <description>&lt;P&gt;Consider this for count and proportion of females for each age.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data indicator;
   set sashelp.class;
   f = sex eq 'F';
   run;
proc summary data=indicator nway missing;
   class age;
   var f;
   output out=females(drop=_:) sum=count mean=prop n=n;
   run;
proc print;
   run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 207px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29085i4C835032FCC6561D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Apr 2019 11:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/554574#M74680</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-04-28T11:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate number of women</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555276#M74702</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; i have run the code and I got this message, please check it out&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; %let dataSetName = gender;
2    *number of observations you want to keep;
3    %let obsKeep = 30;
4
5    %let source_path =
5  ! https://gist.githubusercontent.com/statgeek/bcc55940dd825a13b9c8ca40a904cba9/raw/865d2cf18f515
5  ! 0b8e887218dde0fc3951d0ff15b/data2datastep.sas;
6
7    filename reprex url "&amp;amp;source_path";
8    %include reprex;
169  filename reprex;
NOTE: Fileref REPREX has been deassigned.
170
171  option linesize=max;
172  %data2datastep(dsn=&amp;amp;dataSetName, obs=&amp;amp;obsKeep);
NOTE: No rows were selected.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.17 seconds
      cpu time            0.03 seconds


DATA2DATASTEP DSN &amp;#6;GENDER&amp;#8;
DATA2DATASTEP FILE create_WORK_&amp;#6;GENDER&amp;#8;_data.sas
DATA2DATASTEP FMT &amp;#6;YES&amp;#8;
DATA2DATASTEP FMTLIST
DATA2DATASTEP INPUTLIST code:32. year:32. gender:32. Age:32.
DATA2DATASTEP LBL &amp;#6;YES&amp;#8;
DATA2DATASTEP LBLLIST code="code" year="year" gender="gender" Age="Age"
DATA2DATASTEP LIB &amp;#6;WORK&amp;#8;
DATA2DATASTEP LS 256
DATA2DATASTEP MEMLABEL
DATA2DATASTEP MSGTYPE NOTE
DATA2DATASTEP OBS 30
DATA2DATASTEP OUTLIB WORK
DATA2DATASTEP SQLEXITCODE 0
DATA2DATASTEP SQLOBS 0
DATA2DATASTEP SQLOOPS 17
DATA2DATASTEP SQLRC 0
DATA2DATASTEP SQLXOBS 0
DATA2DATASTEP VARLIST code year gender Age

data WORK.GENDER;
  infile datalines dsd truncover;
  input code:32. year:32. gender:32. Age:32.;
  label code="code" year="year" gender="gender" Age="Age";
datalines;
1 2011 0 56
1 2011 0 53
1 2011 0 49
1 2011 1 52
1 2011 0 64
1 2011 0 62
1 2011 0 62
1 2011 0 50
1 2011 0 47
1 2011 0 58
1 2011 0 47
1 2011 0 60
1 2011 0 49
1 2011 0 57
1 2011 1 49
1 2011 0 62
1 2011 1 41
1 2011 0 63
1 2011 0 55
1 2011 1 55
1 2011 0 40
1 2011 0 37
1 2011 1 55
1 2011 0 36
1 2011 0 43
1 2011 0 54
1 2011 0 46
1 2011 0 45
1 2010 0 56
1 2010 1 48&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 May 2019 05:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555276#M74702</guid>
      <dc:creator>Radwan</dc:creator>
      <dc:date>2019-05-01T05:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate number of women</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555277#M74703</link>
      <description>&lt;P&gt;I will try use it for calculate the number of female in my data&lt;/P&gt;&lt;P&gt;i will let you know if it does not work&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 05:02:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555277#M74703</guid>
      <dc:creator>Radwan</dc:creator>
      <dc:date>2019-05-01T05:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate number of women</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555278#M74704</link>
      <description>It is not what i want&lt;BR /&gt;because this code count the number of female director in total. I need to count the number of female directors in each firm not in whole sample</description>
      <pubDate>Wed, 01 May 2019 05:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555278#M74704</guid>
      <dc:creator>Radwan</dc:creator>
      <dc:date>2019-05-01T05:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate number of women</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555280#M74705</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here, i extract 100 observations to be more clear.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to count the number of female directors in each firm and in each year to be like ( e.g., if the firm 1 has 3 female directors in 2011, in the raw data (that i have it ) appears as 3 observations in same fiscal year, but i need it as one observation in each year with number of female directors 3). i hope you are gonna help me out&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.GENDER;
  infile datalines dsd truncover;
  input code:32. year:32. gender:32. Age:32.;
  label code="code" year="year" gender="gender" Age="Age";
datalines;
1 2011 0 56
1 2011 0 53
1 2011 0 49
1 2011 1 52
1 2011 0 64
1 2011 0 62
1 2011 0 62
1 2011 0 50
1 2011 0 47
1 2011 0 58
1 2011 0 47
1 2011 0 60
1 2011 0 49
1 2011 0 57
1 2011 1 49
1 2011 0 62
1 2011 1 41
1 2011 0 63
1 2011 0 55
1 2011 1 55
1 2011 0 40
1 2011 0 37
1 2011 1 55
1 2011 0 36
1 2011 0 43
1 2011 0 54
1 2011 0 46
1 2011 0 45
1 2010 0 56
1 2010 1 48
1 2010 0 61
1 2010 1 40
1 2010 0 35
1 2010 0 42
1 2010 0 53
1 2010 0 44
1 2010 0 62
1 2010 0 54
1 2010 1 54
1 2010 0 39
1 2010 0 36
1 2010 1 54
1 2010 0 55
1 2010 0 52
1 2010 1 51
1 2010 0 63
1 2010 0 61
1 2010 0 61
1 2010 0 49
1 2010 0 46
1 2010 0 48
1 2010 0 53
1 2010 0 48
1 2009 0 64
1 2009 0 56
1 2009 0 56
1 2009 0 61
1 2009 0 49
1 2009 0 61
1 2009 0 66
1 2009 0 54
1 2009 0 45
1 2009 0 46
1 2009 1 47
1 2009 0 54
1 2009 0 46
1 2009 0 43
1 2009 0 67
1 2009 0 39
1 2009 0 49
1 2009 0 47
1 2009 0 54
1 2009 0 39
1 2009 1 57
1 2009 0 52
1 2009 0 54
1 2009 0 51
1 2008 0 66
1 2008 0 38
1 2008 0 48
1 2008 0 46
1 2008 0 53
1 2008 0 51
1 2008 0 38
1 2008 1 56
1 2008 0 63
1 2008 0 55
1 2008 0 50
1 2008 0 60
1 2008 0 48
1 2008 0 60
1 2008 0 65
1 2008 0 53
1 2008 0 44
1 2008 0 45
1 2008 1 46
1 2008 0 53
1 2008 0 45
1 2008 0 42
1 2008 0 53
;;;;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 May 2019 05:26:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555280#M74705</guid>
      <dc:creator>Radwan</dc:creator>
      <dc:date>2019-05-01T05:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate number of women</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555286#M74706</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it works&amp;nbsp;&lt;/P&gt;&lt;P&gt;i did little changes then i got reasonable result&amp;nbsp;&lt;/P&gt;&lt;P&gt;please have a look on the code&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=gender nway missing;
   class gender;
   var gender;
   by code year;
   output out=femaledirectors(drop=_:) sum=count mean=prop n=n;
   run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 May 2019 06:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555286#M74706</guid>
      <dc:creator>Radwan</dc:creator>
      <dc:date>2019-05-01T06:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate number of women</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555391#M74707</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252600"&gt;@Radwan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it works&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i did little changes then i got reasonable result&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please have a look on the code&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=gender nway missing;
   class gender;
   var gender;
   by code year;
   output out=femaledirectors(drop=_:) sum=count mean=prop n=n;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Or place all of the grouping variables on Class statement. No sorting would be needed.&lt;/P&gt;
&lt;PRE&gt;proc summary data=gender nway missing;
   class gender code year;
   var gender;
   output out=femaledirectors(drop=_:) sum=count mean=prop n=n;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 May 2019 16:07:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555391#M74707</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-01T16:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate number of women</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555650#M74723</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252600"&gt;@Radwan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It is not what i want&lt;BR /&gt;because this code count the number of female director in total. I need to count the number of female directors in each firm not in whole sample&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;My example was posted before you posted data and is an example of a technique.&amp;nbsp; If you haven't use PROC SUMMARY before I suggest you consult the documentation.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 16:26:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/555650#M74723</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-05-02T16:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate number of women</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/566359#M75074</link>
      <description>thanks</description>
      <pubDate>Sat, 15 Jun 2019 11:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-calculate-number-of-women/m-p/566359#M75074</guid>
      <dc:creator>Radwan</dc:creator>
      <dc:date>2019-06-15T11:13:55Z</dc:date>
    </item>
  </channel>
</rss>

