<?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 PROC REG Multiple MODELs with Some Missing Regressor Observations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-REG-Multiple-MODELs-with-Some-Missing-Regressor/m-p/683086#M206843</link>
    <description>&lt;P&gt;I saw &lt;A href="https://communities.sas.com/t5/SAS-Programming/Proc-Reg-several-regressions-with-missing-values/td-p/571516" target="_blank"&gt;Proc Reg several regressions with missing values&lt;/A&gt; that talks about multiple &lt;CODE&gt;model&lt;/CODE&gt;s with some missing &lt;CODE&gt;y&lt;/CODE&gt;s. In short, &lt;CODE&gt;proc reg&lt;/CODE&gt; with multiple &lt;CODE&gt;model&lt;/CODE&gt;s excludes observations with either &lt;CODE&gt;y1&lt;/CODE&gt; or &lt;CODE&gt;y2&lt;/CODE&gt; missing from all of its &lt;CODE&gt;model&lt;/CODE&gt;s. My case is opposite—my &lt;CODE&gt;proc reg&lt;/CODE&gt; with multiple &lt;CODE&gt;model&lt;/CODE&gt;s has some &lt;CODE&gt;x&lt;/CODE&gt; observations missing as follows.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
do i=1 to 5000;
x1=rannor(1);
x2=rannor(1);
x3=rannor(1);
y=x1+x2+x3+rannor(1);
if ranbin(1,1,0.01) then x1=.;
if ranbin(1,1,0.01) then x2=.;
if ranbin(1,1,0.01) then x3=.;
output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I want to make each &lt;CODE&gt;model&lt;/CODE&gt; in the following &lt;CODE&gt;proc reg&lt;/CODE&gt; use all available observations.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg noprint outest=want;
model y=x1;
model y=x2;
model y=x3;
model y=x1 x2;
model y=x1 x3;
model y=x2 x3;
model y=x1 x2 x3/edf;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I cannot apply the method above here because my &lt;CODE&gt;model&lt;/CODE&gt; has different &lt;CODE&gt;x&lt;/CODE&gt;s rather than &lt;CODE&gt;y&lt;/CODE&gt;s. Is separating &lt;CODE&gt;proc reg&lt;/CODE&gt;s the only solution?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Sep 2020 21:40:14 GMT</pubDate>
    <dc:creator>Junyong</dc:creator>
    <dc:date>2020-09-10T21:40:14Z</dc:date>
    <item>
      <title>PROC REG Multiple MODELs with Some Missing Regressor Observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-REG-Multiple-MODELs-with-Some-Missing-Regressor/m-p/683086#M206843</link>
      <description>&lt;P&gt;I saw &lt;A href="https://communities.sas.com/t5/SAS-Programming/Proc-Reg-several-regressions-with-missing-values/td-p/571516" target="_blank"&gt;Proc Reg several regressions with missing values&lt;/A&gt; that talks about multiple &lt;CODE&gt;model&lt;/CODE&gt;s with some missing &lt;CODE&gt;y&lt;/CODE&gt;s. In short, &lt;CODE&gt;proc reg&lt;/CODE&gt; with multiple &lt;CODE&gt;model&lt;/CODE&gt;s excludes observations with either &lt;CODE&gt;y1&lt;/CODE&gt; or &lt;CODE&gt;y2&lt;/CODE&gt; missing from all of its &lt;CODE&gt;model&lt;/CODE&gt;s. My case is opposite—my &lt;CODE&gt;proc reg&lt;/CODE&gt; with multiple &lt;CODE&gt;model&lt;/CODE&gt;s has some &lt;CODE&gt;x&lt;/CODE&gt; observations missing as follows.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
do i=1 to 5000;
x1=rannor(1);
x2=rannor(1);
x3=rannor(1);
y=x1+x2+x3+rannor(1);
if ranbin(1,1,0.01) then x1=.;
if ranbin(1,1,0.01) then x2=.;
if ranbin(1,1,0.01) then x3=.;
output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I want to make each &lt;CODE&gt;model&lt;/CODE&gt; in the following &lt;CODE&gt;proc reg&lt;/CODE&gt; use all available observations.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg noprint outest=want;
model y=x1;
model y=x2;
model y=x3;
model y=x1 x2;
model y=x1 x3;
model y=x2 x3;
model y=x1 x2 x3/edf;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I cannot apply the method above here because my &lt;CODE&gt;model&lt;/CODE&gt; has different &lt;CODE&gt;x&lt;/CODE&gt;s rather than &lt;CODE&gt;y&lt;/CODE&gt;s. Is separating &lt;CODE&gt;proc reg&lt;/CODE&gt;s the only solution?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 21:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-REG-Multiple-MODELs-with-Some-Missing-Regressor/m-p/683086#M206843</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2020-09-10T21:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REG Multiple MODELs with Some Missing Regressor Observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-REG-Multiple-MODELs-with-Some-Missing-Regressor/m-p/683103#M206858</link>
      <description>&lt;P&gt;If by "separating" you mean a separate Proc reg call with a single model statement then pretty much yes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the documentation for Proc Reg:&lt;/P&gt;
&lt;DIV class="xis-refProc"&gt;
&lt;DIV id="statug_reg003456" class="AAsection"&gt;
&lt;P&gt;PROC REG constructs only one crossproducts matrix for the variables in all regressions. If any variable needed for any regression is missing, the observation is excluded from all estimates. If you include variables with missing values in the &lt;A href="http://127.0.0.1:54318/help/statug.hlp/statug_reg_syntax21.htm" target="_blank"&gt;VAR&lt;/A&gt; statement, the corresponding observations are excluded from all analyses, even if you never include the variables in a model. PROC REG assumes that you might want to include these variables after the first RUN statement and deletes observations with missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Sep 2020 22:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-REG-Multiple-MODELs-with-Some-Missing-Regressor/m-p/683103#M206858</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-10T22:12:34Z</dc:date>
    </item>
  </channel>
</rss>

