<?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: Estimating on sub sample, predicting for full sample in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Estimating-on-sub-sample-predicting-for-full-sample/m-p/184792#M303653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the input dataset, create a variable (call it Exp1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data inputdata;&lt;/P&gt;&lt;P&gt;set inputdata;&lt;/P&gt;&lt;P&gt;if exp &amp;gt;= 100 then exp1=exp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else exp1=.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then run proc reg as follows:&lt;/P&gt;&lt;P&gt;proc reg data=&lt;EM&gt;InputData&lt;/EM&gt; outest=&lt;EM&gt;estimates&lt;/EM&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; model Exp1 = lnY lnY_2 &amp;amp;ivset ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output out=Pred_Exp p=predexp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The estimates dataset will have predicted values for all of the data.&amp;nbsp; This use of missing for the dependent variable is a good trick to know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jul 2014 12:47:24 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2014-07-18T12:47:24Z</dc:date>
    <item>
      <title>Estimating on sub sample, predicting for full sample</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Estimating-on-sub-sample-predicting-for-full-sample/m-p/184791#M303652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wish to estimate expenditure on a sub-sample, and use the estimates to predict expenditure for the entire sample. So in the first stage, I regress:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc reg data=&lt;EM&gt;InputData&lt;/EM&gt; outest=&lt;EM&gt;estimates&lt;/EM&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; model Exp = lnY lnY_2 &amp;amp;ivset ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; where Exp ge&amp;nbsp; 100;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output out=Pred_Exp p=predexp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is I then have to manually use the parameter estimates to predict expenditure for the cases with Exp&amp;lt;100. Is there a shorter way to do this than manually using the parameter estimates that I have saved to the dataset &lt;EM&gt;estimates&lt;/EM&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 10:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Estimating-on-sub-sample-predicting-for-full-sample/m-p/184791#M303652</guid>
      <dc:creator>MichaelS</dc:creator>
      <dc:date>2014-07-18T10:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Estimating on sub sample, predicting for full sample</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Estimating-on-sub-sample-predicting-for-full-sample/m-p/184792#M303653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the input dataset, create a variable (call it Exp1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data inputdata;&lt;/P&gt;&lt;P&gt;set inputdata;&lt;/P&gt;&lt;P&gt;if exp &amp;gt;= 100 then exp1=exp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else exp1=.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then run proc reg as follows:&lt;/P&gt;&lt;P&gt;proc reg data=&lt;EM&gt;InputData&lt;/EM&gt; outest=&lt;EM&gt;estimates&lt;/EM&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; model Exp1 = lnY lnY_2 &amp;amp;ivset ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output out=Pred_Exp p=predexp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The estimates dataset will have predicted values for all of the data.&amp;nbsp; This use of missing for the dependent variable is a good trick to know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 12:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Estimating-on-sub-sample-predicting-for-full-sample/m-p/184792#M303653</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-07-18T12:47:24Z</dc:date>
    </item>
  </channel>
</rss>

