<?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: count number of times each id appears in dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898457#M355111</link>
    <description>&lt;P&gt;Not really understanding here. You have millions of observations, you cannot look at them in any reasonably comprehensive way. You said:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;My main goal is to know what is the frequency of the repetition of ids. So all the ids that appear once can be grouped, twice another group, etc.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And then I gave a suggestion on how to do this. If that doesn't work for you, DESCRIBE in a lot more detail what you want, or better yet, show us. Don't make me guess. Don't use words like "visualize" which means different things to different people and doesn't make sense to me in this situation.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2023 09:12:51 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-10-13T09:12:51Z</dc:date>
    <item>
      <title>count number of times each id appears in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898450#M355105</link>
      <description>&lt;P&gt;I want to count the number of times each id appears in the whole dataset.&lt;/P&gt;
&lt;P&gt;data example:&lt;/P&gt;
&lt;PRE&gt;data have;
input id var1 var2;
datalines;
1	0	0
1	0	0
1	1	0
1	0	1
1	1	1
2	0	0
2	1	0
2	1	1
3	1	0
3	0	1
3	0	1
4	0	0
4	1	0
4	0	1
4	1	1
;
run;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I want:&lt;/P&gt;
&lt;PRE&gt;data want;
input id count;
datalines;
1	5
2	3
3	3
4	4
;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 08:12:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898450#M355105</guid>
      <dc:creator>Satori</dc:creator>
      <dc:date>2023-10-13T08:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: count number of times each id appears in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898452#M355107</link>
      <description>&lt;P&gt;Counting is a job for PROC FREQ&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have;
    tables id/noprint out=counts(keep=count id);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 08:31:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898452#M355107</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-13T08:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: count number of times each id appears in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898453#M355108</link>
      <description>I did this, but the dataset hsa millions of observations so the dataset "counts" is huge and I cannot visualize it. Is there another way? My main goal is to know what is the frequency of the repetition of ids. So all the ids that appear once can be grouped, twice another group, etc.</description>
      <pubDate>Fri, 13 Oct 2023 08:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898453#M355108</guid>
      <dc:creator>Satori</dc:creator>
      <dc:date>2023-10-13T08:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: count number of times each id appears in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898455#M355109</link>
      <description>&lt;P&gt;Visualization was not mentioned in your original message. Visualization for what purpose? What type of visualization are you talking about ... please describe in more detail, or show us an example (perhaps from the Internet).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;My main goal is to know what is the frequency of the repetition of ids. So all the ids that appear once can be grouped, twice another group, etc.&lt;/EM&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could sort the output data set, which I named COUNTS, by the variable named COUNT.&lt;/P&gt;
&lt;DIV class="lia-quilt-row lia-quilt-row-footer"&gt;
&lt;DIV class="lia-quilt-column lia-quilt-column-24 lia-quilt-column-single lia-quilt-column-message-footer"&gt;
&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-single"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-single"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Oct 2023 09:01:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898455#M355109</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-13T09:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: count number of times each id appears in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898456#M355110</link>
      <description>By visualize I meant look at the resulting table from the proc freq step.</description>
      <pubDate>Fri, 13 Oct 2023 09:08:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898456#M355110</guid>
      <dc:creator>Satori</dc:creator>
      <dc:date>2023-10-13T09:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: count number of times each id appears in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898457#M355111</link>
      <description>&lt;P&gt;Not really understanding here. You have millions of observations, you cannot look at them in any reasonably comprehensive way. You said:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;My main goal is to know what is the frequency of the repetition of ids. So all the ids that appear once can be grouped, twice another group, etc.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And then I gave a suggestion on how to do this. If that doesn't work for you, DESCRIBE in a lot more detail what you want, or better yet, show us. Don't make me guess. Don't use words like "visualize" which means different things to different people and doesn't make sense to me in this situation.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 09:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898457#M355111</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-13T09:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: count number of times each id appears in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898458#M355112</link>
      <description>&lt;P&gt;Run a second PROC FREQ on the result dataset of the first.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 09:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-number-of-times-each-id-appears-in-dataset/m-p/898458#M355112</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-10-13T09:21:39Z</dc:date>
    </item>
  </channel>
</rss>

