<?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 TTEST 2 sample independent t test in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-TTEST-2-sample-independent-t-test/m-p/452529#M114224</link>
    <description>&lt;P&gt;Your format is incorrect. If you run proc freq with that format on your data you will see that ages 41 and above show the numeric value.&lt;/P&gt;
&lt;P&gt;Your format should be (assuming integer age values)&lt;/P&gt;
&lt;PRE&gt;PROC FORMAT ;
VALUE AGE_P_fmt 18-40='Younger Adults'
41-high='Older Adults';
RUN;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Apr 2018 15:35:22 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-04-09T15:35:22Z</dc:date>
    <item>
      <title>PROC TTEST 2 sample independent t test</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-TTEST-2-sample-independent-t-test/m-p/452153#M114083</link>
      <description>&lt;P&gt;Hi, I'm taking a SAS class and we are doing statistical test programming. I'm trying to run a PROC TTEST on HISTCOR1 and AGE_P, where AGE_P was formatted into 2 groups, but technically there are three groups. There following is my code, with the format for AGE_P given by my professor. The PROC TTEST won't run because there's more than 2 levels, which makes no sense because my WHERE statement says to look only at 18 year old and older.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OPTIONS NOFMTERR;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LIBNAME Mydata 'U:\PUBHBIO 6270\Lab_12';&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC CONTENTS DATA=Mydata.personsx08;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC FORMAT;&lt;BR /&gt;VALUE AGE_P_fmt 18-40='Younger Adults'&lt;BR /&gt;41&amp;gt;='Older Adults';&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC TTEST DATA=Mydata.personsx08 ALPHA=0.05 SIDED=2;&lt;BR /&gt;VAR HICOSTR1;&lt;BR /&gt;WHERE HICOSTR1 not in (99997,99998,99999) AND AGE_P &amp;gt;=18;&lt;BR /&gt;CLASS AGE_P;&lt;BR /&gt;FORMAT AGE_P AGE_P_fmt.;&lt;BR /&gt;TITLE "Mean out-of-pocket premium cost (Plan1): Younger Adults vs. Older Adults";&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Apr 2018 02:30:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-TTEST-2-sample-independent-t-test/m-p/452153#M114083</guid>
      <dc:creator>kmaz</dc:creator>
      <dc:date>2018-04-07T02:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TTEST 2 sample independent t test</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-TTEST-2-sample-independent-t-test/m-p/452156#M114085</link>
      <description>&lt;P&gt;Works fine for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this example below, check if it runs on your machine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it works, there's a bug in your code somewhere. If not, something else is wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please include your log in the future, often the culprit can easily be found by scanning the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value age_fmt
low - 13 = 'Pre Teen'
13 - high = 'Teen';
run;


PROC TTEST DATA=sashelp.class ALPHA=0.05 SIDED=2;
CLASS age ;
format age age_fmt.;
VAR weight;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203354"&gt;@kmaz&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I'm taking a SAS class and we are doing statistical test programming. I'm trying to run a PROC TTEST on HISTCOR1 and AGE_P, where AGE_P was formatted into 2 groups, but technically there are three groups. There following is my code, with the format for AGE_P given by my professor. The PROC TTEST won't run because there's more than 2 levels, which makes no sense because my WHERE statement says to look only at 18 year old and older.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OPTIONS NOFMTERR;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;LIBNAME Mydata 'U:\PUBHBIO 6270\Lab_12';&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;PROC CONTENTS DATA=Mydata.personsx08;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC FORMAT;&lt;BR /&gt;VALUE AGE_P_fmt 18-40='Younger Adults'&lt;BR /&gt;41&amp;gt;='Older Adults';&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC TTEST DATA=Mydata.personsx08 ALPHA=0.05 SIDED=2;&lt;BR /&gt;VAR HICOSTR1;&lt;BR /&gt;WHERE HICOSTR1 not in (99997,99998,99999) AND AGE_P &amp;gt;=18;&lt;BR /&gt;CLASS AGE_P;&lt;BR /&gt;FORMAT AGE_P AGE_P_fmt.;&lt;BR /&gt;TITLE "Mean out-of-pocket premium cost (Plan1): Younger Adults vs. Older Adults";&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Apr 2018 03:05:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-TTEST-2-sample-independent-t-test/m-p/452156#M114085</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-07T03:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TTEST 2 sample independent t test</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-TTEST-2-sample-independent-t-test/m-p/452529#M114224</link>
      <description>&lt;P&gt;Your format is incorrect. If you run proc freq with that format on your data you will see that ages 41 and above show the numeric value.&lt;/P&gt;
&lt;P&gt;Your format should be (assuming integer age values)&lt;/P&gt;
&lt;PRE&gt;PROC FORMAT ;
VALUE AGE_P_fmt 18-40='Younger Adults'
41-high='Older Adults';
RUN;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Apr 2018 15:35:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-TTEST-2-sample-independent-t-test/m-p/452529#M114224</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-09T15:35:22Z</dc:date>
    </item>
  </channel>
</rss>

