<?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: Running LMS regression in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Running-LMS-regression/m-p/54378#M320</link>
    <description>Thanks!</description>
    <pubDate>Fri, 23 Jul 2010 16:48:30 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-07-23T16:48:30Z</dc:date>
    <item>
      <title>Running LMS regression</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Running-LMS-regression/m-p/54376#M318</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to run a LMS regression in SAS/IML, and can successfully get it to run, but I am having trouble controlling the output.  I have 15 independent variables and need the output labeled, but it comes out as var1, var2, etc.&lt;BR /&gt;
&lt;BR /&gt;
Here is what I have:&lt;BR /&gt;
&lt;BR /&gt;
proc iml ;&lt;BR /&gt;
use WORK.auto;&lt;BR /&gt;
read all var {&amp;amp;input &amp;amp;model1} into model1;&lt;BR /&gt;
title "MODEL 1";&lt;BR /&gt;
title2 "5% CENTRALITY BY VALUE";&lt;BR /&gt;
a = model1[1:59,2:16]; &lt;BR /&gt;
b = model1[1:59,1];&lt;BR /&gt;
&lt;BR /&gt;
   optn = j(8,1,.); &lt;BR /&gt;
   optn[2]= 1;&lt;BR /&gt;
   optn[3]= 1;&lt;BR /&gt;
   optn[8]= 1;&lt;BR /&gt;
call lms(sc,coef,wgt,optn,b,a);&lt;BR /&gt;
close work.auto;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
If anyone knows how to get the parameter estimates etc in the output to have the variable names, please let me know.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Wed, 21 Jul 2010 22:39:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Running-LMS-regression/m-p/54376#M318</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-21T22:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Running LMS regression</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Running-LMS-regression/m-p/54377#M319</link>
      <description>The variable names in the ODS tables are obviously being hard-coded as VAR1-VAR16, and I don't think you can change that portion of the output.   The problem, of course, is that the LMS routine takes a matrix of explanatory variable (your 'a' matrix), so it actually doesn't know the names of the data set variables from which the matrix was created.&lt;BR /&gt;
&lt;BR /&gt;
It would be a good idea to extend the LMS routine to provide the functionality you want.&lt;BR /&gt;
&lt;BR /&gt;
You can, however, use ODS output to save the tables to a data set and then use the DATA step or PROC IML to rename the variables.  If you are interested in that, here is some sample code:&lt;BR /&gt;
&lt;BR /&gt;
%let input  = MPG_Highway;&lt;BR /&gt;
%let model1 = EngineSize Horsepower Weight Length;&lt;BR /&gt;
&lt;BR /&gt;
proc iml ;&lt;BR /&gt;
use Sashelp.cars;  /* you'll have this if you have SAS/GRAPH */&lt;BR /&gt;
read all var {&amp;amp;input &amp;amp;model1} into model1;&lt;BR /&gt;
close Sashelp.cars;&lt;BR /&gt;
&lt;BR /&gt;
a = model1[,2:ncol(model1)]; &lt;BR /&gt;
b = model1[,1];&lt;BR /&gt;
optn = j(8,1,.); &lt;BR /&gt;
optn[2]= 1; optn[3]= 1; optn[8]= 1;&lt;BR /&gt;
&lt;BR /&gt;
*ods trace on / listing;&lt;BR /&gt;
ods output EstCoeff=ParamEst;   /* write one or more tables to data sets */&lt;BR /&gt;
call lms(sc,coef,wgt,optn,b,a);&lt;BR /&gt;
ods output close;&lt;BR /&gt;
&lt;BR /&gt;
/* read data with names 'VAR1':'VARn' and 'Intercep' */&lt;BR /&gt;
use ParamEst;&lt;BR /&gt;
read all var _NUM_ into x[colname=oldVarNames];&lt;BR /&gt;
close ParamEst;&lt;BR /&gt;
&lt;BR /&gt;
/* rewrite data with new names */&lt;BR /&gt;
varNames = {&amp;amp;model1} || "Intercep";&lt;BR /&gt;
create ParamEst from x[colname=varNames];  &lt;BR /&gt;
append from x;&lt;BR /&gt;
close ParamEst;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=ParamEst; &lt;BR /&gt;
run;</description>
      <pubDate>Thu, 22 Jul 2010 17:25:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Running-LMS-regression/m-p/54377#M319</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2010-07-22T17:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Running LMS regression</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Running-LMS-regression/m-p/54378#M320</link>
      <description>Thanks!</description>
      <pubDate>Fri, 23 Jul 2010 16:48:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Running-LMS-regression/m-p/54378#M320</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-23T16:48:30Z</dc:date>
    </item>
  </channel>
</rss>

