<?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 Counting the number of patients and frequencies for other categorical variables per study arm in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/316326#M69100</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a clinical trial dataset and am trying to determine the frequencies of a few categorical variables as well as the number of unique patients per study arm at baseline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had initially done proc freq, but since I have multiple rows for each patient due to multiple visits per patient I was told that for proc freq there should only be one row/person. &amp;nbsp;So, the values I got were a count of the same patient numerous times. &amp;nbsp;I was told that I could use the where statement to only get the frequency at&amp;nbsp;the baseline visit, but that did not work either. &amp;nbsp;No observations were read.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is below:&lt;/P&gt;&lt;P&gt;proc freq data=xxxxl;&lt;BR /&gt;where visit="001";&lt;BR /&gt;tables race*group sex*group&amp;nbsp;/norow nopercent;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I received the following message in the log:&amp;nbsp;NOTE: No observations were selected from data set xxx.&lt;BR /&gt;NOTE: There were 0 observations read from the data set xxx.&lt;BR /&gt;WHERE visit='001'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure what I did wrong and what I need to do to get the correct answer. &amp;nbsp;&lt;/P&gt;&lt;P&gt;I am expecting the output to look as follows:&lt;/P&gt;&lt;P&gt;Group 1 &amp;nbsp; &amp;nbsp;Group 2&lt;/P&gt;&lt;P&gt;xxx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxx &amp;nbsp; (these numbers would the number of unique patients in each group)&lt;/P&gt;&lt;P&gt;Race &amp;nbsp; &amp;nbsp;Group 1 &amp;nbsp; &amp;nbsp;Group 2&lt;/P&gt;&lt;P&gt;White &amp;nbsp; &amp;nbsp;xxx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xxx&lt;/P&gt;&lt;P&gt;Black &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;xxx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xxx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Other &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;xxx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xxx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Dec 2016 17:55:23 GMT</pubDate>
    <dc:creator>PaulaC</dc:creator>
    <dc:date>2016-12-02T17:55:23Z</dc:date>
    <item>
      <title>Counting the number of patients and frequencies for other categorical variables per study arm</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/316326#M69100</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a clinical trial dataset and am trying to determine the frequencies of a few categorical variables as well as the number of unique patients per study arm at baseline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had initially done proc freq, but since I have multiple rows for each patient due to multiple visits per patient I was told that for proc freq there should only be one row/person. &amp;nbsp;So, the values I got were a count of the same patient numerous times. &amp;nbsp;I was told that I could use the where statement to only get the frequency at&amp;nbsp;the baseline visit, but that did not work either. &amp;nbsp;No observations were read.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is below:&lt;/P&gt;&lt;P&gt;proc freq data=xxxxl;&lt;BR /&gt;where visit="001";&lt;BR /&gt;tables race*group sex*group&amp;nbsp;/norow nopercent;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I received the following message in the log:&amp;nbsp;NOTE: No observations were selected from data set xxx.&lt;BR /&gt;NOTE: There were 0 observations read from the data set xxx.&lt;BR /&gt;WHERE visit='001'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure what I did wrong and what I need to do to get the correct answer. &amp;nbsp;&lt;/P&gt;&lt;P&gt;I am expecting the output to look as follows:&lt;/P&gt;&lt;P&gt;Group 1 &amp;nbsp; &amp;nbsp;Group 2&lt;/P&gt;&lt;P&gt;xxx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxx &amp;nbsp; (these numbers would the number of unique patients in each group)&lt;/P&gt;&lt;P&gt;Race &amp;nbsp; &amp;nbsp;Group 1 &amp;nbsp; &amp;nbsp;Group 2&lt;/P&gt;&lt;P&gt;White &amp;nbsp; &amp;nbsp;xxx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xxx&lt;/P&gt;&lt;P&gt;Black &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;xxx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xxx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Other &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;xxx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xxx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 17:55:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/316326#M69100</guid>
      <dc:creator>PaulaC</dc:creator>
      <dc:date>2016-12-02T17:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of patients and frequencies for other categorical variables per study arm</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/316327#M69101</link>
      <description>&lt;P&gt;Visit is a character variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then do a proc freq of visit to see what values it actually has in the data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And also note;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where visit='001'&amp;nbsp;will NOT match a right-justified 4-byte visit value of ' 001' (note leading space).&amp;nbsp; If that's the problem, then either&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; where visit=' 001'&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; where left(visit)='001'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 18:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/316327#M69101</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2016-12-02T18:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of patients and frequencies for other categorical variables per study arm</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/316363#M69114</link>
      <description>Yes, visit is a character variable. I strip(visit)="001.00" and I got a result but it did not seem to subset the data to give the counts with only one observation per patient. The number I got was much more than it should be. Thanks.</description>
      <pubDate>Fri, 02 Dec 2016 19:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/316363#M69114</guid>
      <dc:creator>PaulaC</dc:creator>
      <dc:date>2016-12-02T19:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of patients and frequencies for other categorical variables per study arm</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/316366#M69116</link>
      <description>&lt;P&gt;If you get fewer "001.00" cases than expected, then perhaps the original visit coding has errors or incosistencies.&amp;nbsp; I think you have to find a patient with no visit="001.00" to see whether there are other codes indicating baseline visit.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 20:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/316366#M69116</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2016-12-02T20:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of patients and frequencies for other categorical variables per study arm</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/316463#M69159</link>
      <description>&lt;P&gt;Assuming your data is sorted by some patient_Id variable, try keeping the first record for each patient:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data patients;&lt;BR /&gt;set xxxxl; &lt;BR /&gt;by patient_Id;&lt;BR /&gt;if first.patient_Id;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=patients;&lt;BR /&gt;tables race*group sex*group /norow nopercent;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2016 05:14:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/316463#M69159</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-12-03T05:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Counting the number of patients and frequencies for other categorical variables per study arm</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/318001#M69640</link>
      <description>Thank you for your suggestion. I will try that.</description>
      <pubDate>Fri, 09 Dec 2016 21:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-the-number-of-patients-and-frequencies-for-other/m-p/318001#M69640</guid>
      <dc:creator>PaulaC</dc:creator>
      <dc:date>2016-12-09T21:21:53Z</dc:date>
    </item>
  </channel>
</rss>

