<?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: T test for age for cases and control in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/T-test-for-age-for-cases-and-control/m-p/806833#M33587</link>
    <description>&lt;P&gt;TTest wants to test your mean against a value. Typically that means a Class variable to provide two groups and the test is are the means of the group equal. So if you have a variable that indicates "case" or "control" the syntax would be to test the means between two groups. If you don't have such a variable, then add one to your data set.&lt;/P&gt;
&lt;PRE&gt;proc ttest data= work.query;
   class casecontrolvariablename;
   var Baseage;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get a pvalue you must test against something.&lt;/P&gt;
&lt;P&gt;You can provide a value to test your mean against with the H0= option on the Proc statement. For example the code below will test if your mean for the Baseage variable is 21.3 (picked at random to provide a syntax example).&lt;/P&gt;
&lt;PRE&gt;proc ttest data= work.query  H0= 21.3;
   var Baseage;
run;&lt;/PRE&gt;
&lt;P&gt;You should know your data and provide some value that has a use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Apr 2022 19:03:49 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-04-08T19:03:49Z</dc:date>
    <item>
      <title>T test for age for cases and control</title>
      <link>https://communities.sas.com/t5/New-SAS-User/T-test-for-age-for-cases-and-control/m-p/806825#M33586</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to run a t-test for age as it is continuous. I need to find the mean age and p value for age. With the code below I am able to see the overall mean age. However, I am unsure how to find the mean age of my case and control groups. I have tried using Pair statements, I have tried creating a table after the VAR and these are all giving me very different but not correct outputs. Thank you for any guidance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc ttest data= work.query;&lt;/P&gt;
&lt;P&gt;var Baseage;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 18:01:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/T-test-for-age-for-cases-and-control/m-p/806825#M33586</guid>
      <dc:creator>Guerraje</dc:creator>
      <dc:date>2022-04-08T18:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: T test for age for cases and control</title>
      <link>https://communities.sas.com/t5/New-SAS-User/T-test-for-age-for-cases-and-control/m-p/806833#M33587</link>
      <description>&lt;P&gt;TTest wants to test your mean against a value. Typically that means a Class variable to provide two groups and the test is are the means of the group equal. So if you have a variable that indicates "case" or "control" the syntax would be to test the means between two groups. If you don't have such a variable, then add one to your data set.&lt;/P&gt;
&lt;PRE&gt;proc ttest data= work.query;
   class casecontrolvariablename;
   var Baseage;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get a pvalue you must test against something.&lt;/P&gt;
&lt;P&gt;You can provide a value to test your mean against with the H0= option on the Proc statement. For example the code below will test if your mean for the Baseage variable is 21.3 (picked at random to provide a syntax example).&lt;/P&gt;
&lt;PRE&gt;proc ttest data= work.query  H0= 21.3;
   var Baseage;
run;&lt;/PRE&gt;
&lt;P&gt;You should know your data and provide some value that has a use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 19:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/T-test-for-age-for-cases-and-control/m-p/806833#M33587</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-08T19:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: T test for age for cases and control</title>
      <link>https://communities.sas.com/t5/New-SAS-User/T-test-for-age-for-cases-and-control/m-p/806841#M33588</link>
      <description>&lt;P&gt;I added a CLASS statement to compare against my VAR Baseage and was able to get what I was looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 19:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/T-test-for-age-for-cases-and-control/m-p/806841#M33588</guid>
      <dc:creator>Guerraje</dc:creator>
      <dc:date>2022-04-08T19:59:01Z</dc:date>
    </item>
  </channel>
</rss>

