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
Any idea is greatly appreciated. (want: color 1 weight 2.5)
or should I run the second part with something other than HPGENSELECT?
proc hpgenselect data=crab; class Spine; model Satellite= Color Weight Color*Weight /distribution=poisson link=log; run;
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):
/*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;
Not looking for the scoring but just a substitution on the regression.
Isn't there an option like set weight="2.5" or something similar?
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.
Or do you mean set the estimated parameter???
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.