<?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 number of observation in the regression outset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/379691#M276965</link>
    <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a macro to conduct regression analysis using sas 9.4. the goal is to have results for every firm-year, here is the program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%* run regression for each subsample by cusip&amp;nbsp;and store estimation in a file with year identifier.;&lt;/P&gt;&lt;P&gt;proc reg data=one outest =two noprint ;&lt;/P&gt;&lt;P&gt;by cusip;&lt;/P&gt;&lt;P&gt;model dependent_var&amp;nbsp;= independent1 independent2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data out_&amp;amp;fyear.;&lt;/P&gt;&lt;P&gt;set two;&lt;/P&gt;&lt;P&gt;fyear=&amp;amp;fyear.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my question&amp;nbsp;is how can I have the number of observation in the outest file (two)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i used EDF command but it gives me the number of regressors in the model not the number of observations regressed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you in advance&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jul 2017 12:54:45 GMT</pubDate>
    <dc:creator>batool89</dc:creator>
    <dc:date>2017-07-27T12:54:45Z</dc:date>
    <item>
      <title>number of observation in the regression outset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/379691#M276965</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a macro to conduct regression analysis using sas 9.4. the goal is to have results for every firm-year, here is the program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%* run regression for each subsample by cusip&amp;nbsp;and store estimation in a file with year identifier.;&lt;/P&gt;&lt;P&gt;proc reg data=one outest =two noprint ;&lt;/P&gt;&lt;P&gt;by cusip;&lt;/P&gt;&lt;P&gt;model dependent_var&amp;nbsp;= independent1 independent2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data out_&amp;amp;fyear.;&lt;/P&gt;&lt;P&gt;set two;&lt;/P&gt;&lt;P&gt;fyear=&amp;amp;fyear.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my question&amp;nbsp;is how can I have the number of observation in the outest file (two)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i used EDF command but it gives me the number of regressors in the model not the number of observations regressed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you in advance&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 12:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/379691#M276965</guid>
      <dc:creator>batool89</dc:creator>
      <dc:date>2017-07-27T12:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: number of observation in the regression outset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/379693#M276966</link>
      <description>&lt;P&gt;Just to be clear, you want a variable containing the number of pbservations used within each by group in the regression?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 12:56:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/379693#M276966</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-07-27T12:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: number of observation in the regression outset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/379694#M276967</link>
      <description>yes, this is what i want</description>
      <pubDate>Thu, 27 Jul 2017 12:58:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/379694#M276967</guid>
      <dc:creator>batool89</dc:creator>
      <dc:date>2017-07-27T12:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: number of observation in the regression outset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/379935#M276968</link>
      <description>&lt;P&gt;You can do this by adding&amp;nbsp;the variables _P_ and _EDF_&amp;nbsp; to the outest dataset. These are the number of parameters estimated, including the intercept and the error degrees of freedom, which when summed together gives the number of observations.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:25:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/379935#M276968</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-07-27T13:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: number of observation in the regression outset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/380042#M276969</link>
      <description>&lt;P&gt;Use this small example and drop the variables you dont want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data =  sashelp.class;
	by sex;
run;

proc reg data=sashelp.class noprint outest=est;
	by sex;
	model height=weight / sse;
run;

data est;
	set est;
	nObs = _P_ + _EDF_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/380042#M276969</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-07-27T13:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: number of observation in the regression outset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/380898#M276970</link>
      <description>thank you for your response. my regression is a little bit more complicated that requires doing regression for each firm in each year.&lt;BR /&gt;the problem was in having the same error degrees of freedom every year, so i wanted a command that prints the number of observation explicitly so i can check my results.&lt;BR /&gt;i used this equation before and it worked.&lt;BR /&gt;i have just found that the problem is in some of the sample observations.&lt;BR /&gt;thank you again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; and have a nice day&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jul 2017 14:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-observation-in-the-regression-outset/m-p/380898#M276970</guid>
      <dc:creator>batool89</dc:creator>
      <dc:date>2017-07-27T14:50:25Z</dc:date>
    </item>
  </channel>
</rss>

