<?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 How do I find difference of means with standard deviation for age given frequencies in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-find-difference-of-means-with-standard-deviation-for/m-p/573312#M12482</link>
    <description>&lt;P&gt;I'm not sure how to find the differences in mean age between groups with standard deviation for a data file formatted in this layout.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Age&amp;nbsp; &amp;nbsp;Group&amp;nbsp; &amp;nbsp; Frequency&lt;/P&gt;&lt;P&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;27&amp;nbsp;&lt;/P&gt;&lt;P&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;42&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 109&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 22&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;65&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 72&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I originally did was multiply frequency with age and totaled it, and divided by total frequency for that group, however, I'm not sure if there is a more efficient way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 13 Jul 2019 19:59:38 GMT</pubDate>
    <dc:creator>vuhandrew</dc:creator>
    <dc:date>2019-07-13T19:59:38Z</dc:date>
    <item>
      <title>How do I find difference of means with standard deviation for age given frequencies</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-find-difference-of-means-with-standard-deviation-for/m-p/573312#M12482</link>
      <description>&lt;P&gt;I'm not sure how to find the differences in mean age between groups with standard deviation for a data file formatted in this layout.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Age&amp;nbsp; &amp;nbsp;Group&amp;nbsp; &amp;nbsp; Frequency&lt;/P&gt;&lt;P&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;27&amp;nbsp;&lt;/P&gt;&lt;P&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;42&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 109&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 22&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;65&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 72&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I originally did was multiply frequency with age and totaled it, and divided by total frequency for that group, however, I'm not sure if there is a more efficient way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2019 19:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-find-difference-of-means-with-standard-deviation-for/m-p/573312#M12482</guid>
      <dc:creator>vuhandrew</dc:creator>
      <dc:date>2019-07-13T19:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find difference of means with standard deviation for age given frequencies</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-find-difference-of-means-with-standard-deviation-for/m-p/573316#M12483</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/281423"&gt;@vuhandrew&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/281423"&gt;@vuhandrew&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm not sure how to find the differences in mean age between groups with standard deviation for a data file formatted in this layout.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think you're looking for two statistics which are part of PROC TTEST output (highlighted in red below).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Age Group :$1. Frequency;
cards;
0 A 27
0 B 42
1 A 109
1 B 22
2 A 65
2 B 72
;

ods select statistics;
proc ttest data=have;
class group;
freq frequency;
var age;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;Variable:  Age

Group         Method              N        Mean     Std Dev     Std Err     Minimum     Maximum

A                               201      1.1891      0.6512      0.0459           0      2.0000
B                               136      1.2206      0.8919      0.0765           0      2.0000
Diff (1-2)    Pooled                    &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;-0.0315&lt;/FONT&gt;      &lt;FONT color="#FF0000"&gt;0.7574&lt;/FONT&gt;&lt;/STRONG&gt;      0.0841
Diff (1-2)    Satterthwaite             -0.0315                  0.0892&lt;/PRE&gt;
&lt;P&gt;Edit: Needless to say, you can write these statistics to a dataset (e.g. WORK.STATS) for further processing or simply to see more decimals. Just insert an ODS OUTPUT statement into or before the PROC TTEST step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output statistics=stats;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;proc print data=stats noobs label;&lt;BR /&gt;where method=:'P';&lt;BR /&gt;format _numeric_ best17.;&lt;BR /&gt;var mean stddev;&lt;BR /&gt;label mean='Difference in mean age (A - B)';&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;    Difference in
 mean age (A - B)              Std Dev

-0.03153350892596     0.75744715265964&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2019 21:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-find-difference-of-means-with-standard-deviation-for/m-p/573316#M12483</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-07-13T21:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find difference of means with standard deviation for age given frequencies</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-find-difference-of-means-with-standard-deviation-for/m-p/573325#M12484</link>
      <description>&lt;P&gt;Thank you for your help! I really appreciate it.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2019 22:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-find-difference-of-means-with-standard-deviation-for/m-p/573325#M12484</guid>
      <dc:creator>vuhandrew</dc:creator>
      <dc:date>2019-07-13T22:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find difference of means with standard deviation for age given frequencies</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-find-difference-of-means-with-standard-deviation-for/m-p/573671#M12550</link>
      <description>&lt;P&gt;If you need simple summary statistics for each level of group variable(s) you can use one of the procedures such as Means or Summary with the count as Freq variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc means data=have;
   class group;
   var age;
   freq frequency;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jul 2019 19:49:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-find-difference-of-means-with-standard-deviation-for/m-p/573671#M12550</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-15T19:49:14Z</dc:date>
    </item>
  </channel>
</rss>

