<?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: Coding Question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217608#M53547</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="814511" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/" modifiedtitle="true" title="RW9"&gt;&lt;/A&gt; is correct -- no need to split the data.&amp;nbsp; However, one improvement on this answer: you don't need to use BY groups or SORT the data first with PROC MEANS.&amp;nbsp; You can use the CLASS statement instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Consolas; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;means&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=sashelp.classfit &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;noprint&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; age;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;class&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; sex;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;output&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=myres &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;n&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;n&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;mean&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;mean&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;stddev&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;stddev&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;min&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;min&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;max&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="classout.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/9941_classout.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first record is the stats for ALL observations, and the next two records are for F and M, respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2015 13:20:05 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2015-04-08T13:20:05Z</dc:date>
    <item>
      <title>Coding Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217606#M53545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am struggling with coding with following questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to find difference between male and female from dataset and find significance between male and female.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, should I subset or split dataset? &lt;/P&gt;&lt;P&gt;There are variables for each male and female so I think I need to create a new variable with add number of variables. &lt;/P&gt;&lt;P&gt;What is a code to get significance between male and female? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me, &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 03:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217606#M53545</guid>
      <dc:creator>Wendy13</dc:creator>
      <dc:date>2015-04-08T03:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Coding Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217607#M53546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You shouldn't need to split your dataset, SAS does by group processing so just use gender as a by or class variable.&amp;nbsp; E.g. &lt;/P&gt;&lt;P&gt;proc sort data=sashelp.classfit out=tmp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by sex;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc means data=tmp noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var age;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by sex;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output out=myres n=n mean=mean stddev=stddev min=min max=max;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;This will give you means results by sex from the sashelp table.&lt;/P&gt;&lt;P&gt;As for significance, not sure, your best off posting that question in Statistical Procedures sub forum.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 13:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217607#M53546</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-08T13:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Coding Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217608#M53547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="814511" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/" modifiedtitle="true" title="RW9"&gt;&lt;/A&gt; is correct -- no need to split the data.&amp;nbsp; However, one improvement on this answer: you don't need to use BY groups or SORT the data first with PROC MEANS.&amp;nbsp; You can use the CLASS statement instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Consolas; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;means&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=sashelp.classfit &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;noprint&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; age;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;class&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; sex;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;output&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=myres &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;n&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;n&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;mean&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;mean&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;stddev&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;stddev&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;min&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;min&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;max&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="classout.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/9941_classout.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first record is the stats for ALL observations, and the next two records are for F and M, respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 13:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217608#M53547</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-04-08T13:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Coding Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217609#M53548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you only need to analyze one variable, you could get everything you want by running proc ttest. e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc ttest data=sashelp.class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; class sex;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; var weight;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 14:16:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217609#M53548</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-04-08T14:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Coding Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217610#M53549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;... IF (big if) your data has a normal distribution. Otherwise, or instead, since there is not is not much power lost, go for non-parametric analyses :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc npar1way data=sashelp.class Wilcoxon;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; class sex;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; var weight;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; exact Wilcoxon;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 15:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217610#M53549</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-04-08T15:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Coding Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217611#M53550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF you have more than two levels, Don't forget to use variance analysis .&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;proc glm&lt;/P&gt;&lt;P&gt;proc anova &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 14:02:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Coding-Question/m-p/217611#M53550</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-04-09T14:02:09Z</dc:date>
    </item>
  </channel>
</rss>

