<?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: How to substitute a variable in HPGENSELECT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-substitute-a-variable-in-HPGENSELECT/m-p/866693#M342287</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;not sure if your question is about scoring of the new cases or definition of input variable types. Attached is code that might help you (data are toy example):&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;/*see https://support.sas.com/documentation/onlinedoc/stat/141/hpgenselect.pdf*/
/*of https://support.sas.com/documentation/onlinedoc/stat/143/stathpug.pdf*/
proc hpgenselect data=sashelp.class ;
class   sex;
model age= sex weight sex*weight ;*/link=log distribution=poisson ; 
selection 
	METHOD=STEPWISE 
	DETAILS=all
;
output out=myOut xbeta predicted=Pred;
code File='c:\temp\ScoringParameters.sas';
run;

data to_be_predicted;
sex='F'; weight=88; output;
sex='M'; weight=99; output;
run;

data prediction;
set to_be_predicted;
%include 'c:\temp\ScoringParameters.sas';
run;
proc print data=prediction;run;

data all_in_hpgenselect;
set sashelp.class to_be_predicted;
run;
proc print data=all_in_hpgenselect;run;

proc hpgenselect data=all_in_hpgenselect ;
class   sex;
model age= sex weight sex*weight ;*/link=log distribution=poisson ; 
selection 
	METHOD=STEPWISE 
	DETAILS=all
;
ID name sex age weight;
output out=myOut_with_prediction xbeta predicted=Pred;
code File='c:\temp\ScoringParameters.sas';
run;
proc print data=myOut_with_prediction;run;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2023 08:33:12 GMT</pubDate>
    <dc:creator>czejap</dc:creator>
    <dc:date>2023-03-28T08:33:12Z</dc:date>
    <item>
      <title>How to substitute a variable in HPGENSELECT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-substitute-a-variable-in-HPGENSELECT/m-p/866642#M342264</link>
      <description>&lt;P&gt;Hello, calculated a logistic regression with HPGENSELECT as I needed stepwise to calculate the model. After some search can't find the appropriate code to substitute the variables for which the parameters made it on the regression&lt;/P&gt;
&lt;P&gt;Any idea is greatly appreciated. (want: color 1 weight 2.5)&lt;/P&gt;
&lt;P&gt;or should I run the second part with something other than HPGENSELECT?&lt;/P&gt;
&lt;PRE&gt;proc hpgenselect data=crab;
class Spine;
model Satellite= Color Weight Color*Weight /distribution=poisson link=log; 
run;


&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 21:41:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-substitute-a-variable-in-HPGENSELECT/m-p/866642#M342264</guid>
      <dc:creator>Mruizv</dc:creator>
      <dc:date>2023-03-27T21:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to substitute a variable in HPGENSELECT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-substitute-a-variable-in-HPGENSELECT/m-p/866693#M342287</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;not sure if your question is about scoring of the new cases or definition of input variable types. Attached is code that might help you (data are toy example):&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;/*see https://support.sas.com/documentation/onlinedoc/stat/141/hpgenselect.pdf*/
/*of https://support.sas.com/documentation/onlinedoc/stat/143/stathpug.pdf*/
proc hpgenselect data=sashelp.class ;
class   sex;
model age= sex weight sex*weight ;*/link=log distribution=poisson ; 
selection 
	METHOD=STEPWISE 
	DETAILS=all
;
output out=myOut xbeta predicted=Pred;
code File='c:\temp\ScoringParameters.sas';
run;

data to_be_predicted;
sex='F'; weight=88; output;
sex='M'; weight=99; output;
run;

data prediction;
set to_be_predicted;
%include 'c:\temp\ScoringParameters.sas';
run;
proc print data=prediction;run;

data all_in_hpgenselect;
set sashelp.class to_be_predicted;
run;
proc print data=all_in_hpgenselect;run;

proc hpgenselect data=all_in_hpgenselect ;
class   sex;
model age= sex weight sex*weight ;*/link=log distribution=poisson ; 
selection 
	METHOD=STEPWISE 
	DETAILS=all
;
ID name sex age weight;
output out=myOut_with_prediction xbeta predicted=Pred;
code File='c:\temp\ScoringParameters.sas';
run;
proc print data=myOut_with_prediction;run;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 08:33:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-substitute-a-variable-in-HPGENSELECT/m-p/866693#M342287</guid>
      <dc:creator>czejap</dc:creator>
      <dc:date>2023-03-28T08:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to substitute a variable in HPGENSELECT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-substitute-a-variable-in-HPGENSELECT/m-p/867352#M342553</link>
      <description>&lt;P&gt;Not looking for the scoring but just a substitution on the regression.&lt;/P&gt;
&lt;P&gt;Isn't there an option like set weight="2.5" or something similar?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 20:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-substitute-a-variable-in-HPGENSELECT/m-p/867352#M342553</guid>
      <dc:creator>Mruizv</dc:creator>
      <dc:date>2023-03-30T20:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to substitute a variable in HPGENSELECT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-substitute-a-variable-in-HPGENSELECT/m-p/867363#M342561</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/402297"&gt;@Mruizv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Not looking for the scoring but just a substitution on the regression.&lt;/P&gt;
&lt;P&gt;Isn't there an option like set weight="2.5" or something similar?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That sounds like a pass through a data step setting all the values of a variable to that fixed value. But I can't tell if you want this before regression (which is going to very drastically change any model) or in some form of output, at which point I'm not sure of the utitlity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or do you mean set the estimated parameter???&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 00:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-substitute-a-variable-in-HPGENSELECT/m-p/867363#M342561</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-31T00:04:35Z</dc:date>
    </item>
  </channel>
</rss>

