<?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: Category Specific Quartiles in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Category-Specific-Quartiles/m-p/925597#M364238</link>
    <description>&lt;P&gt;This makes sense now! Thank you for the explanation I appreciate it!!&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2024 16:19:20 GMT</pubDate>
    <dc:creator>kaitlynanderson</dc:creator>
    <dc:date>2024-04-24T16:19:20Z</dc:date>
    <item>
      <title>Category Specific Quartiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Category-Specific-Quartiles/m-p/925427#M364192</link>
      <description>&lt;P&gt;I have a homework and I am being tasked with creating "sex specific quartiles". Here are the exact instructions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create &lt;U&gt;sex-specific&lt;/U&gt; quartiles for the variables “&lt;EM&gt;zdelta_muac&lt;/EM&gt;” and “&lt;EM&gt;zdelta_bmi&lt;/EM&gt;” (using the “&lt;EM&gt;visitdata4&lt;/EM&gt;” dataset) and call the new ranked variables “&lt;EM&gt;q4s_zdelta_muac”&lt;/EM&gt; and “&lt;EM&gt;q4s_zdelta_bmi&lt;/EM&gt;.” Output these results into a new temporary dataset called “&lt;EM&gt;visitdata5&lt;/EM&gt;.”&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where zdelta_muac and zdelta_bmi are standardized variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*sex-specific quartiles*/&lt;BR /&gt;proc sort data=visitdata4;&lt;BR /&gt;by sex;&lt;BR /&gt;run;&lt;BR /&gt;proc rank data=visitdata4 out=visitdata5;&lt;BR /&gt;by sex;&lt;BR /&gt;var zdelta_muac zdelta_bmi;&lt;BR /&gt;ranks q4s_zdelta_muac q4s_zdelta_bmi;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I have, but when I run this, it deletes a bunch of observations from visitdata4.&amp;nbsp; How do I make this not happen&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 18:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Category-Specific-Quartiles/m-p/925427#M364192</guid>
      <dc:creator>kaitlynanderson</dc:creator>
      <dc:date>2024-04-23T18:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Category Specific Quartiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Category-Specific-Quartiles/m-p/925429#M364193</link>
      <description>&lt;P&gt;To do quartiles I would expect to see the option GROUPS=4 on the Proc Rank.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have missing values for your BY variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Normally Proc Rank doesn't remove observations. Can you show us the LOG where you use Proc Rank to create Visitdata5?&lt;/P&gt;
&lt;P&gt;Copy the text from the Log with the code and all the notes or messages. On the forum open a text box using the &amp;lt;/&amp;gt; icon above the message window and paste all the text.&lt;/P&gt;
&lt;P&gt;That would look something like this (your variables and sets differ of course)&lt;/P&gt;
&lt;PRE&gt;3694  proc rank data=work.class groups=4 out=work.classrank;
3695     by sex;
3696     var height weight;
3697     ranks h_rank w_rank;
3698  run;

NOTE: There were 19 observations read from the data set WORK.CLASS.
NOTE: The data set WORK.CLASSRANK has 19 observations and 7 variables.
NOTE: PROCEDURE RANK used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Apr 2024 18:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Category-Specific-Quartiles/m-p/925429#M364193</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-23T18:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Category Specific Quartiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Category-Specific-Quartiles/m-p/925432#M364194</link>
      <description>&lt;P&gt;I forgot the groups = 4 and added that in. Here is a snippet of what my visitdata4 looks like.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-23 at 2.57.42 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95787iD385CAD7712B4E2E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-04-23 at 2.57.42 PM.png" alt="Screenshot 2024-04-23 at 2.57.42 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then I run this code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*sex-specific quartiles*/&lt;BR /&gt;proc sort data=visitdata4;&lt;BR /&gt;by sex;&lt;BR /&gt;run;&lt;BR /&gt;proc rank data=visitdata4 out=visitdata5 groups =4 ;&lt;BR /&gt;by sex;&lt;BR /&gt;var zdelta_muac zdelta_bmi;&lt;BR /&gt;ranks q4s_zdelta_muac q4s_zdelta_bmi;&lt;BR /&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and it now visitdata 4 looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-23 at 2.59.11 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95788i98423B0142D99941/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-04-23 at 2.59.11 PM.png" alt="Screenshot 2024-04-23 at 2.59.11 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Here is the log for the proc rank:&lt;/P&gt;&lt;DIV class=""&gt;NOTE: There were 197 observations read from the data set WORK.VISITDATA4.&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: The data set WORK.VISITDATA5 has 197 observations and 25 variables.&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: PROCEDURE RANK used (Total process time):&lt;/DIV&gt;&lt;DIV class=""&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;user cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;system cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;memory 2831.28k&lt;/DIV&gt;&lt;DIV class=""&gt;OS Memory 23724.00k&lt;/DIV&gt;&lt;DIV class=""&gt;Timestamp 04/23/2024 06:59:36 PM&lt;/DIV&gt;&lt;DIV class=""&gt;Step Count 99 Switch Count 4&lt;/DIV&gt;&lt;DIV class=""&gt;Page Faults 0&lt;/DIV&gt;&lt;DIV class=""&gt;Page Reclaims 251&lt;/DIV&gt;&lt;DIV class=""&gt;Page Swaps 0&lt;/DIV&gt;&lt;DIV class=""&gt;Voluntary Context Switches 20&lt;/DIV&gt;&lt;DIV class=""&gt;Involuntary Context Switches 0&lt;/DIV&gt;&lt;DIV class=""&gt;Block Input Operations 0&lt;/DIV&gt;&lt;DIV class=""&gt;Block Output Operations 528&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;thanks for the help!&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Apr 2024 19:01:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Category-Specific-Quartiles/m-p/925432#M364194</guid>
      <dc:creator>kaitlynanderson</dc:creator>
      <dc:date>2024-04-23T19:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Category Specific Quartiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Category-Specific-Quartiles/m-p/925453#M364205</link>
      <description>&lt;P&gt;Your log bit&lt;/P&gt;
&lt;PRE&gt;NOTE: There were 197 observations read from the data set WORK.VISITDATA4.
NOTE: The data set WORK.VISITDATA5 has 197 observations and 25 variables.&lt;/PRE&gt;
&lt;P&gt;Confirms than no observations were deleted.&lt;/P&gt;
&lt;P&gt;If you are showing Visitdata4 (visitdata5 would look the same), it is showing the SORT order from your sex variable. Sex is missing for 5 observations. The places where sex is missing seems to be associated with missing other variables as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I bet a small pile of $$$ that if you run something like this (or with any of your Visitdata1, Visitdata2 guessing these exist) then you will see that Sex is missing for 5 observations.&lt;/P&gt;
&lt;PRE&gt;proc freq data=visitdata3;
   tables sex / missing;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ranks for observations where the By variable is missing will be missing as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 20:24:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Category-Specific-Quartiles/m-p/925453#M364205</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-23T20:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Category Specific Quartiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Category-Specific-Quartiles/m-p/925597#M364238</link>
      <description>&lt;P&gt;This makes sense now! Thank you for the explanation I appreciate it!!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 16:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Category-Specific-Quartiles/m-p/925597#M364238</guid>
      <dc:creator>kaitlynanderson</dc:creator>
      <dc:date>2024-04-24T16:19:20Z</dc:date>
    </item>
  </channel>
</rss>

