<?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 use a &amp;quot;count&amp;quot; variable value... in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-a-quot-count-quot-variable-value/m-p/947043#M42525</link>
    <description>&lt;P&gt;That is exactly what I was looking for. Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2024 18:07:19 GMT</pubDate>
    <dc:creator>sasgorilla</dc:creator>
    <dc:date>2024-10-10T18:07:19Z</dc:date>
    <item>
      <title>How to use a "count" variable value...</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-a-quot-count-quot-variable-value/m-p/947039#M42523</link>
      <description>&lt;P&gt;I have a data set where a "count" variable means there are X numbers of individuals with the preceding characteristics in that observation. See below as an example. In the first observation, 3 means there are three 24 year-old males who scored 100.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data sample;
input age score sex$ count;
datalines;
24	100 M 3
25	95 F 2
25	97 M 2
20	86 M 3
30	100	F 2	
;
RUN;&lt;/PRE&gt;&lt;P&gt;Let's say I wanted to do a proc freq of sex * score.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC FREQ data=sample;
     TABLES sex*score;
run;&lt;/PRE&gt;&lt;P&gt;Is there a way to call out the actual number of each sex achieving each score by using the "count" value for each observation? My code above counts only one sex per row, obviously.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 17:49:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-use-a-quot-count-quot-variable-value/m-p/947039#M42523</guid>
      <dc:creator>sasgorilla</dc:creator>
      <dc:date>2024-10-10T17:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a "count" variable value...</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-a-quot-count-quot-variable-value/m-p/947041#M42524</link>
      <description>&lt;P&gt;Use a &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/procstat/procstat_freq_syntax13.htm" target="_self"&gt;WEIGHT statement&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The WEIGHT statement names a numeric variable that provides a weight for each observation in the input data set. The WEIGHT statement is most commonly used to input cell count data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 10 Oct 2024 17:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-use-a-quot-count-quot-variable-value/m-p/947041#M42524</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-10-10T17:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a "count" variable value...</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-a-quot-count-quot-variable-value/m-p/947043#M42525</link>
      <description>&lt;P&gt;That is exactly what I was looking for. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 18:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-use-a-quot-count-quot-variable-value/m-p/947043#M42525</guid>
      <dc:creator>sasgorilla</dc:creator>
      <dc:date>2024-10-10T18:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a "count" variable value...</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-a-quot-count-quot-variable-value/m-p/947052#M42528</link>
      <description>&lt;P&gt;Some procedures other than Proc Freq support both Weight and Freq statements.&lt;/P&gt;
&lt;P&gt;Consider if you are asked for the Mean and Standard deviation of the Scores.&lt;/P&gt;
&lt;P&gt;You might try:&lt;/P&gt;
&lt;PRE&gt;Proc means data=sample;
   title "With WEIGHT statement";
   var score;
   weight count;
run;&lt;/PRE&gt;
&lt;P&gt;Which shows a result of&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;TABLE class="systitleandfootercontainer" summary="Page Layout" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l systemtitle"&gt;With WEIGHT statement&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Means: Summary statistics" cellspacing="0" cellpadding="3"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c m header" colspan="5" scope="colgroup" width="429.55px"&gt;Analysis Variable : score&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="c m header" scope="col" width="40px"&gt;N&lt;/TH&gt;
&lt;TH class="c m header" scope="col" width="92px"&gt;Mean&lt;/TH&gt;
&lt;TH class="c m header" scope="col" width="81px"&gt;Std Dev&lt;/TH&gt;
&lt;TH class="c m header" scope="col" width="104.35px"&gt;Minimum&lt;/TH&gt;
&lt;TH class="c m header" scope="col" width="112.2px"&gt;Maximum&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="40px" class="r data"&gt;5&lt;/TD&gt;
&lt;TD width="92px" class="r data"&gt;95.1666667&lt;/TD&gt;
&lt;TD width="81px" class="r data"&gt;9.6910612&lt;/TD&gt;
&lt;TD width="104.35px" class="r data"&gt;86.0000000&lt;/TD&gt;
&lt;TD width="112.2px" class="r data"&gt;100.0000000&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the N shown does not match the "count" that would be expected.&lt;/P&gt;
&lt;P&gt;So consider:&lt;/P&gt;
&lt;PRE&gt;Proc means data=sample;
   title "With FREQ statement";
   var score;
   Freq count;
run;&lt;/PRE&gt;
&lt;P&gt;with a result:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;TABLE class="systitleandfootercontainer" summary="Page Layout" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l systemtitle"&gt;With FREQ statement&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Means: Summary statistics" cellspacing="0" cellpadding="3"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c m header" colspan="5" scope="colgroup"&gt;Analysis Variable : score&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="c m header" scope="col"&gt;N&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;Mean&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;Std Dev&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;Minimum&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;Maximum&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;12&lt;/TD&gt;
&lt;TD class="r data"&gt;95.1666667&lt;/TD&gt;
&lt;TD class="r data"&gt;5.8439298&lt;/TD&gt;
&lt;TD class="r data"&gt;86.0000000&lt;/TD&gt;
&lt;TD class="r data"&gt;100.0000000&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Now N looks like the total of Count and the Standard Deviation here uses the larger N in the calculation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For most procedures that have both Weight and Freq statements you would want the Freq option to identify such a count variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Oct 2024 19:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-use-a-quot-count-quot-variable-value/m-p/947052#M42528</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-10-10T19:50:25Z</dc:date>
    </item>
  </channel>
</rss>

