<?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-stat for intercept difference in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/589295#M75939</link>
    <description>&lt;P&gt;Do you want OLS or time series regression?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For OLS regression, you can use the CLASS statement and set the reference level of the ID variable to ID1. For example, here is an example that sets the reference level for the TYPE variable in an OLS regression?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc glm data=sashelp.cars;
where type in ('Sedan' 'SUV' 'Truck' 'Wagon' 'Sports');
class type(ref='SUV');   /* set reference level for classification variable */
model mpg_city = weight type / solution;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 17 Sep 2019 10:14:20 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2019-09-17T10:14:20Z</dc:date>
    <item>
      <title>t-stat for intercept difference</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/589286#M75937</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have run a regression on a dataset that has 2 different IDs, there is one X and one Y variable. I have an intercept and a coefficient for each one of these two IDs. My ultimate purpose is to Subtract intercept of ID5 from the intercept of ID1 (b0 (ID5) - b0 (ID1)) and measure NeweyWest t-stat of this difference. Please guide me in this regard, thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See the code below that I am using for regression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods exclude all;
proc model data=Have;
 by ID;
       endo Y;
         exog X;
         instruments _exog_;
         parms b0 b1;
         Y=b0 + b1*X;
         fit Y / gmm kernel=(bart,5,0) vardef=n;
		ods output parameterestimates=Want;
         run;
ods exclude none;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 04:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/589286#M75937</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2019-09-18T04:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: t-stat for intercept difference</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/589295#M75939</link>
      <description>&lt;P&gt;Do you want OLS or time series regression?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For OLS regression, you can use the CLASS statement and set the reference level of the ID variable to ID1. For example, here is an example that sets the reference level for the TYPE variable in an OLS regression?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc glm data=sashelp.cars;
where type in ('Sedan' 'SUV' 'Truck' 'Wagon' 'Sports');
class type(ref='SUV');   /* set reference level for classification variable */
model mpg_city = weight type / solution;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2019 10:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/589295#M75939</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-09-17T10:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: t-stat for intercept difference</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/589523#M75944</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;: Thanks for your reply. I think my question was not very clear. I have attached a sample of my data. I want to run OLS regression (not time series) on this data, and find t-stat for the difference in intercepts of these two IDs. Please guide. Thanks.</description>
      <pubDate>Wed, 18 Sep 2019 04:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/589523#M75944</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2019-09-18T04:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: t-stat for intercept difference</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/589778#M75956</link>
      <description>&lt;P&gt;What is the model? Are the Month and Year variables important? Do you want the slopes to depend on the ID, or just the intercepts?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the model is Y = X and the ID only affects the intercept, you can use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=Have;
   class ID(ref='5');
   model Y = X ID / solution;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the ParameterEstimates table, the row for 'ID 1' shows the difference between the ID=1 level and the reference level (which is ID=5).&amp;nbsp; The 't Value' column gives the value of the t statistic and the ''Pr &amp;gt; |t|)' column is the p value for the statistic.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 18:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/589778#M75956</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-09-18T18:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: t-stat for intercept difference</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/589862#M75960</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;: My Y variable is monthly Returns, and X is Volatility. I want to run a simple OLS model i.e. Y=a+bX, grouped by ID. This means one intercept and beta from ID1, and one intercept and beta from ID5 should be shown by the regression. Year and Month are not of a concern in this regression. I am using proc model because I need Newey-West corrected standard errors and t-stat. If proc glm is used to measure the significance of intercepts difference, how would Newey-West approach be applied then? Please guide. Thanks</description>
      <pubDate>Wed, 18 Sep 2019 23:00:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/589862#M75960</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2019-09-18T23:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: t-stat for intercept difference</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/590028#M75963</link>
      <description>&lt;P&gt;I believe I answered your first question. The intercept for ID=5 is the Intercept term in the model. The intercept for ID=1 is (Intercept + the estimate for ID=1).&amp;nbsp; If you also want the slope to depend on the ID variable, change the model to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MODEL&amp;nbsp;Y = X | ID / solution;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know anything about&amp;nbsp;&lt;SPAN&gt;Newey-West corrected standard errors, but you can ask questions about PROC MODEL and time series in the SAS Forecasting and Econometric community. From Wikipedia, it appears that Newey-West corrections are for autocorrelated and heteroskedastic errors in time series data. OLS regression assumes that you do not have autocorrelation or heteroskedasticity.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 13:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/t-stat-for-intercept-difference/m-p/590028#M75963</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-09-19T13:44:10Z</dc:date>
    </item>
  </channel>
</rss>

