<?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: frequencies and average in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/505035#M25963</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;COW_ID	         CAL_TE	      CEA       PR       TEST_DATE
71988495	06/09/2011	1	4	10/01/2012
71988495	06/09/2011	1	4	02/02/2012
71988495	06/09/2011	1	4	06/03/2012
71988495	06/09/2011	1	4	05/04/2012
71988495	06/09/2011	1	3	05/05/2012
75170579	07/10/2013	1	3	15/01/2014
75170579	07/10/2013	1	2	12/12/2013
75170579	07/10/2013	1	1	15/11/2013
75170579	07/10/2013	1	3	10/06/2014
76506914	19/03/2012	3	4	08/08/2012
76506914	19/03/2012	3	1	28/06/2012
76506914	19/03/2012	3	1	19/04/2012
76506914	19/03/2012	3	4	29/05/2012
77966344	17/01/2012	2	3	14/03/2012
77966344	17/01/2012	2	2	03/05/2012
77966344	17/01/2012	2	1	05/04/2012
77966344	17/01/2012	2	3	01/06/2012
77966344	17/01/2012	2	2	01/09/2012
77966344	17/01/2012	2	4	07/07/2012
77966344	17/01/2012	2	1	01/08/2012
77966344	17/01/2012	2	3	04/10/2012
77966344	17/01/2012	2	1	03/11/2012
82867861	02/05/2011	3	1	03/02/2012
82985152	01/09/2011	2	2	02/07/2012
82985152	01/09/2011	2	2	01/06/2012
82985152	01/09/2011	2	2	02/04/2012
82985152	01/09/2011	2	2	02/05/2012
82985152	01/09/2011	2	2	02/01/2012
82985152	01/09/2011	2	3	01/02/2012
82985152	01/09/2011	2	3	01/03/2012
108172029	29/05/2011	1	3	02/02/2012
108172029	29/05/2011	1	3	09/03/2012
108279276	27/05/2011	1	1	08/03/2012
108279276	27/05/2011	1	2	06/01/2012
108279276	27/05/2011	1	3	03/02/2012
110186178	18/08/2011	1	3	11/01/2012
110186178	18/08/2011	1	3	09/02/2012
110186178	18/08/2011	1	4	13/03/2012
110186178	18/08/2011	1	4	11/06/2012
110186178	18/08/2011	1	4	16/04/2012
110186178	18/08/2011	1	1	14/05/2012
110206340	13/11/2011	1	1	29/08/2012&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is my data, I didn't use any coed, but I just tried to use the normal proc freq as pr * cow_id, but it doesn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Oct 2018 11:58:25 GMT</pubDate>
    <dc:creator>Barkamih</dc:creator>
    <dc:date>2018-10-17T11:58:25Z</dc:date>
    <item>
      <title>frequencies and average</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/504824#M25952</link>
      <description>&lt;P&gt;Hi all&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data called fat, and it has variable PR and TEST DATE as well as COW ID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Each cow&amp;nbsp;has four test dates or more, and PR variable&amp;nbsp;has four different&amp;nbsp;levels.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is I want to know the average number of test dates per cow for each PR level.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;someone told me it could be by using proc freq for cow id * pr, but I couldn't figure out that code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you got my query&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ibrahim&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 18:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/504824#M25952</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-10-16T18:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: frequencies and average</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/504839#M25953</link>
      <description>&lt;P&gt;Please show an example of your data and the SAS code you have tried.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 19:15:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/504839#M25953</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-10-16T19:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: frequencies and average</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/504853#M25954</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151600"&gt;@Barkamih&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have data called fat, and it has variable PR and TEST DATE as well as COW ID.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Each cow&amp;nbsp;has four test dates or more, and PR variable&amp;nbsp;has four different&amp;nbsp;levels.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is I want to know the average number of test dates per cow for each PR level.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;someone told me it could be by using proc freq for cow id * pr, but I couldn't figure out that code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope you got my query&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ibrahim&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;"COW ID" is not normally&amp;nbsp; acceptable as a SAS variable name, spaces are not allowed.&lt;/P&gt;
&lt;P&gt;So first check on the names of your variables.&lt;/P&gt;
&lt;P&gt;You should show the code you attempted and any notes or messages from the LOG when things aren't working correctly.&lt;/P&gt;
&lt;P&gt;Copy the text from the log, open a code box one the forum using the {I} icon and paste the code and any messages.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 19:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/504853#M25954</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-16T19:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: frequencies and average</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/505035#M25963</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;COW_ID	         CAL_TE	      CEA       PR       TEST_DATE
71988495	06/09/2011	1	4	10/01/2012
71988495	06/09/2011	1	4	02/02/2012
71988495	06/09/2011	1	4	06/03/2012
71988495	06/09/2011	1	4	05/04/2012
71988495	06/09/2011	1	3	05/05/2012
75170579	07/10/2013	1	3	15/01/2014
75170579	07/10/2013	1	2	12/12/2013
75170579	07/10/2013	1	1	15/11/2013
75170579	07/10/2013	1	3	10/06/2014
76506914	19/03/2012	3	4	08/08/2012
76506914	19/03/2012	3	1	28/06/2012
76506914	19/03/2012	3	1	19/04/2012
76506914	19/03/2012	3	4	29/05/2012
77966344	17/01/2012	2	3	14/03/2012
77966344	17/01/2012	2	2	03/05/2012
77966344	17/01/2012	2	1	05/04/2012
77966344	17/01/2012	2	3	01/06/2012
77966344	17/01/2012	2	2	01/09/2012
77966344	17/01/2012	2	4	07/07/2012
77966344	17/01/2012	2	1	01/08/2012
77966344	17/01/2012	2	3	04/10/2012
77966344	17/01/2012	2	1	03/11/2012
82867861	02/05/2011	3	1	03/02/2012
82985152	01/09/2011	2	2	02/07/2012
82985152	01/09/2011	2	2	01/06/2012
82985152	01/09/2011	2	2	02/04/2012
82985152	01/09/2011	2	2	02/05/2012
82985152	01/09/2011	2	2	02/01/2012
82985152	01/09/2011	2	3	01/02/2012
82985152	01/09/2011	2	3	01/03/2012
108172029	29/05/2011	1	3	02/02/2012
108172029	29/05/2011	1	3	09/03/2012
108279276	27/05/2011	1	1	08/03/2012
108279276	27/05/2011	1	2	06/01/2012
108279276	27/05/2011	1	3	03/02/2012
110186178	18/08/2011	1	3	11/01/2012
110186178	18/08/2011	1	3	09/02/2012
110186178	18/08/2011	1	4	13/03/2012
110186178	18/08/2011	1	4	11/06/2012
110186178	18/08/2011	1	4	16/04/2012
110186178	18/08/2011	1	1	14/05/2012
110206340	13/11/2011	1	1	29/08/2012&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is my data, I didn't use any coed, but I just tried to use the normal proc freq as pr * cow_id, but it doesn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 11:58:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/505035#M25963</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-10-17T11:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: frequencies and average</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/505038#M25964</link>
      <description>&lt;P&gt;thanks for your replay, I knew the space issue, what I'm looking is how to create the proper code for this question,&amp;nbsp; &amp;nbsp;I didn't&amp;nbsp;use any code yet except the proc freq code as cow_id * pr, but it doesn't work, actually, it worked but I didn't&amp;nbsp;get my needs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 13:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/505038#M25964</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-10-17T13:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: frequencies and average</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/505056#M25968</link>
      <description>&lt;P&gt;this code just showing the frequency of cow_id, but I'm looking for the average number of cow_id of all data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 13:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/505056#M25968</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-10-17T13:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: frequencies and average</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/505308#M25989</link>
      <description>&lt;P&gt;Example input data and example output for the given input really helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example of determining the average number of models of cars per make (or brand). You should have this data set to examine.&lt;/P&gt;
&lt;PRE&gt;proc freq data=sashelp.cars noprint;
   tables make*type /out=makecount;
run;

proc means data=makecount mean;
  var count;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first step counts how many times combinations of &amp;nbsp;MAKE and TYPE&amp;nbsp;appear in the data. In this case there is one record per MODEL.&lt;/P&gt;
&lt;P&gt;Then average the resulting count. Which yields the average number of records for MAKE and type combinations.&lt;/P&gt;
&lt;P&gt;I think that COWID would take the place of MAKE and TYPE would be your PR. Which would give the average number of records per cow and pr.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need something else, provide some small actual example data for input and the output you want for that input.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 19:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/505308#M25989</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-17T19:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: frequencies and average</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/505490#M25999</link>
      <description>&lt;P&gt;thank you&amp;nbsp;soooooooo much my brother.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the answer from this code. this requirement will be the last thing I was looking for to finish my first paper for publication.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might need your help for the second paper, be always online hahahahah.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brakamih&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 11:00:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/frequencies-and-average/m-p/505490#M25999</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-10-18T11:00:42Z</dc:date>
    </item>
  </channel>
</rss>

