<?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 after regression by year in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/t-test-after-regression-by-year/m-p/460337#M24062</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check frequency distribution of variable g before t-test.&lt;/P&gt;</description>
    <pubDate>Sun, 06 May 2018 23:56:36 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2018-05-06T23:56:36Z</dc:date>
    <item>
      <title>t-test after regression by year</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/t-test-after-regression-by-year/m-p/460330#M24061</link>
      <description>&lt;P&gt;I am trying to run regression of GDP on Investment by year, and want to t-test the coefficient on investment by dividing the sample into two groups in the middle year of all years. For this, I had the following.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=work noprint outest=investdata;
    by year;
    model gdp=investm1 invest investp1;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;investm1 and investp1 are lag and lead values of invest because I needed to control them in the regression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then for t-test,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I split the years into g=0 or 1 at the mid-year of sample years using data step on dataset 'investdata'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I typed in&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc ttest data=investdata;
class g;
var invest;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get error message saying I don't have n,std,mean. Desired output would be whether coefficient on invest is significantly different from before and after at the five percent significance level.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where did I do wrong? Is there other ways I could possibly get the output that I want? Thank you for your help in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 22:36:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/t-test-after-regression-by-year/m-p/460330#M24061</guid>
      <dc:creator>kelSAS</dc:creator>
      <dc:date>2018-05-06T22:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: t-test after regression by year</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/t-test-after-regression-by-year/m-p/460337#M24062</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check frequency distribution of variable g before t-test.&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 23:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/t-test-after-regression-by-year/m-p/460337#M24062</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2018-05-06T23:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: t-test after regression by year</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/t-test-after-regression-by-year/m-p/460879#M24070</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/152943"&gt;@kelSAS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to run regression of GDP on Investment by year, and want to t-test the coefficient on investment by dividing the sample into two groups in the middle year of all years. For this, I had the following.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=work noprint outest=investdata;
    by year;
    model gdp=investm1 invest investp1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;investm1 and investp1 are lag and lead values of invest because I needed to control them in the regression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then for t-test,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I split the years into g=0 or 1 at the mid-year of sample years using data step on dataset 'investdata'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I typed in&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc ttest data=investdata;
class g;
var invest;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get error message saying I don't have n,std,mean. Desired output would be whether coefficient on invest is significantly different from before and after at the five percent significance level.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where did I do wrong? Is there other ways I could possibly get the output that I want? Thank you for your help in advance.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Proc Ttest has two forms. One involves having multiple records for each value of your class and var variables. SAS then calculates the means, standard deviations and such from the data. The other is a test involving the summarized data with the statistics provided by you for each level of the class variable. If you don't provide enough records of the class and var variables then SAS assumes you are attempting to use a summarized data set. In which case the data is expected to have a field named _stat_ containing the n, mean, std of the variable invest for two levels of the class variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to say I am having a very hard time telling what&lt;/P&gt;
&lt;PRE&gt;I split the years into g=0 or 1 at the mid-year of sample years using data step on dataset 'investdata'&lt;/PRE&gt;
&lt;P&gt;actually means in data terms. I don't see a variable that looks like it would have sufficient information to determine a "mid-year" to "split" on. Or does your "year" variable carry more than year information with it? if so, what does your data actually look like? How many "years" do you have data for?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 22:35:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/t-test-after-regression-by-year/m-p/460879#M24070</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-08T22:35:27Z</dc:date>
    </item>
  </channel>
</rss>

