<?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: Proc Freq to get the count in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/848028#M82350</link>
    <description>&lt;P&gt;answer is as is in the original post. I just got confused.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 05:04:15 GMT</pubDate>
    <dc:creator>Ayooo1</dc:creator>
    <dc:date>2022-12-06T05:04:15Z</dc:date>
    <item>
      <title>Proc Freq to get the count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847554#M82336</link>
      <description>&lt;P&gt;I'm fairly new at this and ran into a problem with proc freq. An practice task says I need to proc freq a merged dataset by sex*treatment and get the count for each gender by treatment and by treatment and get the count by treatment. I'm not too sure about how to get the count. Is what I'm doing correct?&lt;/P&gt;&lt;P&gt;example data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 07:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847554#M82336</guid>
      <dc:creator>Ayooo1</dc:creator>
      <dc:date>2022-12-03T07:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq to get the count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847555#M82337</link>
      <description>&lt;P&gt;data Listing;&lt;BR /&gt;merge Ex Dm;&lt;BR /&gt;by SUBJID&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=Listing;&lt;BR /&gt;tables SEX*EXDSTXT/out=FreqST;&lt;BR /&gt;tables EXDSTXT/out=FreqT;&lt;BR /&gt;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;select SEX, EXDSTXT, count(*) as Count&lt;BR /&gt;from FreqST&lt;BR /&gt;group by SEX,EXDSTXT;&lt;BR /&gt;select EXDSTXT, count (*) as Count&lt;BR /&gt;from FreqT&lt;BR /&gt;group by EXDSTXT;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 07:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847555#M82337</guid>
      <dc:creator>Ayooo1</dc:creator>
      <dc:date>2022-12-03T07:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq to get the count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847566#M82339</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437459"&gt;@Ayooo1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;Is what I'm doing correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you get the right answer when you run the code? Do you get errors in the log when you run the code?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 12:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847566#M82339</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-03T12:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq to get the count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847567#M82340</link>
      <description>&lt;P&gt;the code runs but does not give the right count.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 12:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847567#M82340</guid>
      <dc:creator>Ayooo1</dc:creator>
      <dc:date>2022-12-03T12:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq to get the count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847569#M82341</link>
      <description>&lt;P&gt;Show us. Also, please provide data not in an attachment, but as SAS code pasted into the window that appears when you click on the&amp;nbsp; "little running man" icon.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 13:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847569#M82341</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-03T13:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq to get the count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847571#M82342</link>
      <description>&lt;P&gt;This is my task:&lt;/P&gt;&lt;P&gt;1. Assigned dose variable can be used as treatment group.&lt;/P&gt;&lt;P&gt;2. Retrieve the initial dose(the first dosage of the subject, sorted by subjid and dose)&lt;/P&gt;&lt;P&gt;hint:&lt;BR /&gt;Proc sort; by subjid dose; run;&lt;BR /&gt;Data xxx;&lt;BR /&gt;set xxx;&lt;BR /&gt;by subjid dose;&lt;BR /&gt;If first.subjid;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;3. merge with sex variable from dm by subjid&lt;/P&gt;&lt;P&gt;4. Proc freq by sex*treatment and get the count for each gender by treatment&lt;/P&gt;&lt;P&gt;5. Proc freq by treatment and get the count by treatment&lt;/P&gt;&lt;P&gt;6. Merge 5 and 6 by treatment and calculate the percentage and concatenate count and percentage together.&lt;BR /&gt;7. Proc transpose to form se frequency block like table shell.&lt;/P&gt;&lt;P&gt;proc sort data=Sasfile.Ex;&lt;BR /&gt;by SUBJID EXDSTXT;&lt;BR /&gt;run;&lt;BR /&gt;data Ex;&lt;BR /&gt;set Sasfile.Ex;&lt;BR /&gt;by SUBJID EXDSTXT;&lt;BR /&gt;keep SUBJID EXDSTXT;&lt;BR /&gt;if first.SUBJID;&lt;BR /&gt;run;&lt;BR /&gt;data Dm;&lt;BR /&gt;set Sasfile.Dm;&lt;BR /&gt;keep SUBJID SEX;&lt;BR /&gt;if SEX="M" then SEX="Male";else SEX="Female";&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=Dm;&lt;BR /&gt;by SUBJID;&lt;BR /&gt;run;&lt;BR /&gt;data Listing2;&lt;BR /&gt;merge Ex Dm;&lt;BR /&gt;by SUBJID;&lt;BR /&gt;run;&lt;BR /&gt;proc freq data=Listing2;&lt;BR /&gt;tables SEX*EXDSTXT /out=FreqST;&lt;BR /&gt;tables EXDSTXT/out=FreqT;&lt;BR /&gt;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;select SEX, EXDSTXT, count(*) as Count&lt;BR /&gt;from FreqST&lt;BR /&gt;group by SEX,EXDSTXT;&lt;BR /&gt;select EXDSTXT, count (*) as Count&lt;BR /&gt;from FreqT&lt;BR /&gt;group by EXDSTXT;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 13:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847571#M82342</guid>
      <dc:creator>Ayooo1</dc:creator>
      <dc:date>2022-12-03T13:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq to get the count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847573#M82343</link>
      <description>&lt;P&gt;So what is wrong here? You said the results are wrong ... show us the results and explain what is wrong. Show us data sets FREQST and FREQT.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 13:38:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847573#M82343</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-03T13:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq to get the count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847574#M82344</link>
      <description>&lt;P&gt;Never mind. I figured it out. Thank you for helping.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 14:12:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847574#M82344</guid>
      <dc:creator>Ayooo1</dc:creator>
      <dc:date>2022-12-03T14:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq to get the count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847624#M82345</link>
      <description>&lt;P&gt;Please update your post as answered in that case.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Dec 2022 03:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847624#M82345</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-04T03:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq to get the count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847638#M82346</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437459"&gt;@Ayooo1&lt;/a&gt;&amp;nbsp;Please provide the answer so that other can learn.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Dec 2022 12:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/847638#M82346</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-04T12:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq to get the count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/848028#M82350</link>
      <description>&lt;P&gt;answer is as is in the original post. I just got confused.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 05:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-to-get-the-count/m-p/848028#M82350</guid>
      <dc:creator>Ayooo1</dc:creator>
      <dc:date>2022-12-06T05:04:15Z</dc:date>
    </item>
  </channel>
</rss>

