<?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: PROC GLM predict values on some regressors in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-GLM-predict-values-on-some-regressors/m-p/66332#M18939</link>
    <description>It seems that there's no option to output the design matrix X.&lt;BR /&gt;
According to the last paragraph of &lt;A href="http://support.sas.com/onlinedoc/913/getDoc/en/statug.hlp/glm_sect29.htm" target="_blank"&gt;http://support.sas.com/onlinedoc/913/getDoc/en/statug.hlp/glm_sect29.htm&lt;/A&gt;, the design matrix is not actually constructed.&lt;BR /&gt;
Basically you got to generate the design matrix for factors in X1 by yourself using the rules on that web page before multiply it with the estimate of b1.</description>
    <pubDate>Fri, 19 Dec 2008 04:39:14 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-12-19T04:39:14Z</dc:date>
    <item>
      <title>PROC GLM predict values on some regressors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-GLM-predict-values-on-some-regressors/m-p/66331#M18938</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I'm running a PROC GLM with two groups of regressors - say vectors X1 and X2 (some of which are class variables). The standard OUTPUT statement allows me to compute the predicted values of the Y on X1 and X2.&lt;BR /&gt;
&lt;BR /&gt;
However, I need to predict Y only with the information in X1, i.e. instead of b1*X1+b2*X2, just b1*X1.&lt;BR /&gt;
&lt;BR /&gt;
As these vectors have thousands of variables, I can't do it manually. Do you know of a way to do it in SAS?&lt;BR /&gt;
&lt;BR /&gt;
Thanks a lot!&lt;BR /&gt;
Stefano</description>
      <pubDate>Wed, 17 Dec 2008 18:07:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-GLM-predict-values-on-some-regressors/m-p/66331#M18938</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-12-17T18:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: PROC GLM predict values on some regressors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-GLM-predict-values-on-some-regressors/m-p/66332#M18939</link>
      <description>It seems that there's no option to output the design matrix X.&lt;BR /&gt;
According to the last paragraph of &lt;A href="http://support.sas.com/onlinedoc/913/getDoc/en/statug.hlp/glm_sect29.htm" target="_blank"&gt;http://support.sas.com/onlinedoc/913/getDoc/en/statug.hlp/glm_sect29.htm&lt;/A&gt;, the design matrix is not actually constructed.&lt;BR /&gt;
Basically you got to generate the design matrix for factors in X1 by yourself using the rules on that web page before multiply it with the estimate of b1.</description>
      <pubDate>Fri, 19 Dec 2008 04:39:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-GLM-predict-values-on-some-regressors/m-p/66332#M18939</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-12-19T04:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC GLM predict values on some regressors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-GLM-predict-values-on-some-regressors/m-p/66333#M18940</link>
      <description>Thanks a lot, I will do it manually then.</description>
      <pubDate>Sun, 21 Dec 2008 18:23:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-GLM-predict-values-on-some-regressors/m-p/66333#M18940</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-12-21T18:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC GLM predict values on some regressors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-GLM-predict-values-on-some-regressors/m-p/66334#M18941</link>
      <description>You don't have to, because PROC GLMMOD will generate the design matrix for you. For example,&lt;BR /&gt;
/*&lt;BR /&gt;
  data plants; &lt;BR /&gt;
      input Type $ @; &lt;BR /&gt;
      do Block = 1 to 3; &lt;BR /&gt;
         input StemLength @; &lt;BR /&gt;
         output; &lt;BR /&gt;
         end; &lt;BR /&gt;
      datalines; &lt;BR /&gt;
   Clarion  32.7 32.3 31.5 &lt;BR /&gt;
   Clinton  32.1 29.7 29.1 &lt;BR /&gt;
   Knox     35.7 35.9 33.1 &lt;BR /&gt;
   O'Neill  36.0 34.2 31.2 &lt;BR /&gt;
   Compost  31.8 28.0 29.2 &lt;BR /&gt;
   Wabash   38.2 37.8 31.9 &lt;BR /&gt;
   Webster  32.5 31.1 29.7 &lt;BR /&gt;
   ; &lt;BR /&gt;
 ods output designpoints=X(drop=obsnumber stemlength);&lt;BR /&gt;
 proc glmmod; &lt;BR /&gt;
      class Block Type; &lt;BR /&gt;
      model StemLength = Block Type; &lt;BR /&gt;
   run; &lt;BR /&gt;
ods output parameterestimates=b(keep=estimate) predictedvalues=yhat;&lt;BR /&gt;
   proc glm data=plants; &lt;BR /&gt;
      class Block Type; &lt;BR /&gt;
      model StemLength = Block Type/p solution; &lt;BR /&gt;
run;&lt;BR /&gt;
proc iml;&lt;BR /&gt;
use x;&lt;BR /&gt;
read all var _num_ into X;&lt;BR /&gt;
use b;&lt;BR /&gt;
read all var {estimate} into b;&lt;BR /&gt;
yhat = x*b;&lt;BR /&gt;
b1 = b;&lt;BR /&gt;
b1[5:11]=0;&lt;BR /&gt;
yhat1 = x*b1;&lt;BR /&gt;
print b b1;&lt;BR /&gt;
print yhat yhat1;&lt;BR /&gt;
quit;&lt;BR /&gt;
*/&lt;BR /&gt;
where b are the estimates of intercept, block, and type; yhat=X*b are the predicted values using both block and type; b1 are the estimates of intercept and block only; yhat1 = X*b1 are the predicated values using block only.&lt;BR /&gt;
reference: &lt;A href="http://support.sas.com/kb/23/217.html" target="_blank"&gt;http://support.sas.com/kb/23/217.html&lt;/A&gt;</description>
      <pubDate>Wed, 31 Dec 2008 23:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-GLM-predict-values-on-some-regressors/m-p/66334#M18941</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-12-31T23:04:43Z</dc:date>
    </item>
  </channel>
</rss>

