<?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 proc ttest output with weight option returns unweighted sample size counts? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-ttest-output-with-weight-option-returns-unweighted-sample/m-p/848021#M42007</link>
    <description>&lt;P&gt;While running proc ttest I've noticed SAS returns the same sample size (N) values for my class variable whether I'm using weights or no weights (see code below).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my data the Treatment records all have inv_weight = 1 while the Control records have inv_weight between values between 0 and 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that the mean and stnd deviation statistics for the Controls differ for weighted/unweighted proc ttest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm assuming SAS is correctly performing the weighted t-test but for whatever reasons outputs the unweighted N counts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc ttest data=&amp;amp;bcbsri order=data;
      class class;
      var er_bsln_ptmpy;
      weight inv_weight;
run;
/*
                                                      The TTEST Procedure

                                                      Variable:  er_bsln_ptmpy

Weight: inv_weight

                         class                N        Mean     Std Dev     Std Err     Minimum     Maximum

                         Treatment          703      1147.9      1975.1     74.4936           0     26000.0
                         Control        1183962       843.6       418.0      1.2572           0     20000.0
                         Diff (1-2)                   304.4       420.6     15.9142                        

                   class         Method               Mean       95% CL Mean        Std Dev      95% CL Std Dev

                   Treatment                        1147.9      1001.7   1294.2      1975.1      1877.0   2084.2
                   Control                           843.6       841.1    846.0       418.0       417.5    418.5
                   Diff (1-2)    Pooled              304.4       273.2    335.5       420.6       420.1    421.2
                   Diff (1-2)    Satterthwaite       304.4       158.1    450.6                                 

                                    Method           Variances        DF    t Value    Pr &amp;gt; |t|

                                    Pooled           Equal        1.18E6      19.12      &amp;lt;.0001
                                    Satterthwaite    Unequal       702.4       4.09      &amp;lt;.0001

                                                       Equality of Variances

                                         Method      Num DF    Den DF    F Value    Pr &amp;gt; F

                                         Folded F       702    1.18E6      22.33    &amp;lt;.0001
*/
proc ttest data=&amp;amp;bcbsri order=data;
      class class;
      var er_bsln_ptmpy;
/*    weight inv_weight;*/
run;
/*
                                                       The TTEST Procedure

                                                      Variable:  er_bsln_ptmpy

                         class                N        Mean     Std Dev     Std Err     Minimum     Maximum

                         Treatment          703      1147.9      1975.1     74.4936           0     26000.0
                         Control        1183962       753.7      1370.1      1.2592           0     20000.0
                         Diff (1-2)                   394.2      1370.6     51.7069                        

                   class         Method               Mean       95% CL Mean        Std Dev      95% CL Std Dev

                   Treatment                        1147.9      1001.7   1294.2      1975.1      1877.0   2084.2
                   Control                           753.7       751.2    756.2      1370.1      1368.4   1371.9
                   Diff (1-2)    Pooled              394.2       292.9    495.6      1370.6      1368.8   1372.3
                   Diff (1-2)    Satterthwaite       394.2       248.0    540.5                                 

                                    Method           Variances        DF    t Value    Pr &amp;gt; |t|

                                    Pooled           Equal        1.18E6       7.62      &amp;lt;.0001
                                    Satterthwaite    Unequal       702.4       5.29      &amp;lt;.0001

                                                       Equality of Variances

                                         Method      Num DF    Den DF    F Value    Pr &amp;gt; F

                                         Folded F       702    1.18E6       2.08    &amp;lt;.0001
*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 03:10:31 GMT</pubDate>
    <dc:creator>RobertWF2</dc:creator>
    <dc:date>2022-12-06T03:10:31Z</dc:date>
    <item>
      <title>proc ttest output with weight option returns unweighted sample size counts?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-ttest-output-with-weight-option-returns-unweighted-sample/m-p/848021#M42007</link>
      <description>&lt;P&gt;While running proc ttest I've noticed SAS returns the same sample size (N) values for my class variable whether I'm using weights or no weights (see code below).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my data the Treatment records all have inv_weight = 1 while the Control records have inv_weight between values between 0 and 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that the mean and stnd deviation statistics for the Controls differ for weighted/unweighted proc ttest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm assuming SAS is correctly performing the weighted t-test but for whatever reasons outputs the unweighted N counts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc ttest data=&amp;amp;bcbsri order=data;
      class class;
      var er_bsln_ptmpy;
      weight inv_weight;
run;
/*
                                                      The TTEST Procedure

                                                      Variable:  er_bsln_ptmpy

Weight: inv_weight

                         class                N        Mean     Std Dev     Std Err     Minimum     Maximum

                         Treatment          703      1147.9      1975.1     74.4936           0     26000.0
                         Control        1183962       843.6       418.0      1.2572           0     20000.0
                         Diff (1-2)                   304.4       420.6     15.9142                        

                   class         Method               Mean       95% CL Mean        Std Dev      95% CL Std Dev

                   Treatment                        1147.9      1001.7   1294.2      1975.1      1877.0   2084.2
                   Control                           843.6       841.1    846.0       418.0       417.5    418.5
                   Diff (1-2)    Pooled              304.4       273.2    335.5       420.6       420.1    421.2
                   Diff (1-2)    Satterthwaite       304.4       158.1    450.6                                 

                                    Method           Variances        DF    t Value    Pr &amp;gt; |t|

                                    Pooled           Equal        1.18E6      19.12      &amp;lt;.0001
                                    Satterthwaite    Unequal       702.4       4.09      &amp;lt;.0001

                                                       Equality of Variances

                                         Method      Num DF    Den DF    F Value    Pr &amp;gt; F

                                         Folded F       702    1.18E6      22.33    &amp;lt;.0001
*/
proc ttest data=&amp;amp;bcbsri order=data;
      class class;
      var er_bsln_ptmpy;
/*    weight inv_weight;*/
run;
/*
                                                       The TTEST Procedure

                                                      Variable:  er_bsln_ptmpy

                         class                N        Mean     Std Dev     Std Err     Minimum     Maximum

                         Treatment          703      1147.9      1975.1     74.4936           0     26000.0
                         Control        1183962       753.7      1370.1      1.2592           0     20000.0
                         Diff (1-2)                   394.2      1370.6     51.7069                        

                   class         Method               Mean       95% CL Mean        Std Dev      95% CL Std Dev

                   Treatment                        1147.9      1001.7   1294.2      1975.1      1877.0   2084.2
                   Control                           753.7       751.2    756.2      1370.1      1368.4   1371.9
                   Diff (1-2)    Pooled              394.2       292.9    495.6      1370.6      1368.8   1372.3
                   Diff (1-2)    Satterthwaite       394.2       248.0    540.5                                 

                                    Method           Variances        DF    t Value    Pr &amp;gt; |t|

                                    Pooled           Equal        1.18E6       7.62      &amp;lt;.0001
                                    Satterthwaite    Unequal       702.4       5.29      &amp;lt;.0001

                                                       Equality of Variances

                                         Method      Num DF    Den DF    F Value    Pr &amp;gt; F

                                         Folded F       702    1.18E6       2.08    &amp;lt;.0001
*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 03:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-ttest-output-with-weight-option-returns-unweighted-sample/m-p/848021#M42007</guid>
      <dc:creator>RobertWF2</dc:creator>
      <dc:date>2022-12-06T03:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc ttest output with weight option returns unweighted sample size counts?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-ttest-output-with-weight-option-returns-unweighted-sample/m-p/848025#M42008</link>
      <description>&lt;P&gt;PROC TTEST is correct. Weights do not affect Ns. The FREQ statement affects Ns.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 03:28:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-ttest-output-with-weight-option-returns-unweighted-sample/m-p/848025#M42008</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2022-12-06T03:28:18Z</dc:date>
    </item>
  </channel>
</rss>

