Hi all,
I would like to save the output of the proc glmselect in a separate file. For example, I want to create a file containing the list of the selected variables and the estimates of their coefficients that are provided in the result widow.
proc glmselect data=&infile plots(stepaxis=normb)=coefficients;
model &depvar=indepvar
/ selection=LASSO(adaptive stop=none choose=cvex) cvmethod=random(10);
run;
I tried output out= but it didn't save what I need. Appreciate any help!
If you want the information that is sent to results window in a data set the generic approach is:
ODS OUTPUT resulttablename = yourdatasetname;
either before inside the Proc Code but before a Run;
You can get the names of tables generated by your code by running it with
ods trace on;
<procedure code>
ods trace off; /* you don't want to keep generating all that stuff*/
the LOG will show the names of the names use.
Or the DETAILS section of the online help for a procedure generally has a section labeled "ODS Table Names" with the names and the options to create the table such as:
Table 49.11: ODS Tables Produced by PROC GLMSELECT
ODS Table Name |
Description |
Statement |
Option |
---|---|---|---|
ANOVA |
Selected model ANOVA table |
Default |
|
AvgParmEst |
Average parameter estimates |
Default |
|
BSplineDetails |
B-spline basis details |
DETAILS |
|
Candidates |
Entry/removal effect ranking |
||
ClassLevelCoding |
Classification variable coding |
SHOWCODING |
|
ClassLevelInfo |
Classification variable levels |
Default |
|
CollectionLevelInfo |
Levels of collection effects |
DETAILS |
|
CVDetails |
Cross validation PRESS by fold |
||
Dimensions |
Number of effects and parameters |
Default |
|
EffectSelectPct |
Effect selection percentages |
Default |
|
FitStatistics |
Selected model fit statistics |
Default |
|
MMLevelInfo |
Levels of multimember effects |
DETAILS |
|
ModelAvgInfo |
Model averaging information |
Default |
|
ModelInfo |
Model information |
Default |
|
ModelSelectFreq |
Model selection frequencies |
Default |
|
NObs |
Number of observations |
Default |
|
ParameterNames |
Labels for column names in the design matrix |
OUTDESIGN(names) |
|
ParameterEstimates |
Selected model parameter estimates |
Default |
|
PerfSettings |
Performance settings |
||
PolynomialDetails |
Polynomial details |
DETAILS |
|
PolynomialScaling |
Polynomial scaling |
DETAILS |
|
RefitAvgParmEst |
Refit average parameter estimates |
REFIT |
|
ScoreInfo |
Score request information |
Default |
|
SelectedEffects |
List of selected effects |
Default |
|
SelectionSummary |
Selection summary |
Default |
|
StopDetails |
Stopping criterion details |
Default |
|
StopReason |
Reason why selection stopped |
Default |
|
Timing |
Timing details |
||
TPFSplineDeatils |
Truncated power function spline basis details |
DETAILS |
Since GLMselect can make a fair number of tables I am not going to guess which one you want. If you wanted the SelectedEffects you would use something like
ods output SelectedEffects=myeffectsset;
For each output table.
If you want the information that is sent to results window in a data set the generic approach is:
ODS OUTPUT resulttablename = yourdatasetname;
either before inside the Proc Code but before a Run;
You can get the names of tables generated by your code by running it with
ods trace on;
<procedure code>
ods trace off; /* you don't want to keep generating all that stuff*/
the LOG will show the names of the names use.
Or the DETAILS section of the online help for a procedure generally has a section labeled "ODS Table Names" with the names and the options to create the table such as:
Table 49.11: ODS Tables Produced by PROC GLMSELECT
ODS Table Name |
Description |
Statement |
Option |
---|---|---|---|
ANOVA |
Selected model ANOVA table |
Default |
|
AvgParmEst |
Average parameter estimates |
Default |
|
BSplineDetails |
B-spline basis details |
DETAILS |
|
Candidates |
Entry/removal effect ranking |
||
ClassLevelCoding |
Classification variable coding |
SHOWCODING |
|
ClassLevelInfo |
Classification variable levels |
Default |
|
CollectionLevelInfo |
Levels of collection effects |
DETAILS |
|
CVDetails |
Cross validation PRESS by fold |
||
Dimensions |
Number of effects and parameters |
Default |
|
EffectSelectPct |
Effect selection percentages |
Default |
|
FitStatistics |
Selected model fit statistics |
Default |
|
MMLevelInfo |
Levels of multimember effects |
DETAILS |
|
ModelAvgInfo |
Model averaging information |
Default |
|
ModelInfo |
Model information |
Default |
|
ModelSelectFreq |
Model selection frequencies |
Default |
|
NObs |
Number of observations |
Default |
|
ParameterNames |
Labels for column names in the design matrix |
OUTDESIGN(names) |
|
ParameterEstimates |
Selected model parameter estimates |
Default |
|
PerfSettings |
Performance settings |
||
PolynomialDetails |
Polynomial details |
DETAILS |
|
PolynomialScaling |
Polynomial scaling |
DETAILS |
|
RefitAvgParmEst |
Refit average parameter estimates |
REFIT |
|
ScoreInfo |
Score request information |
Default |
|
SelectedEffects |
List of selected effects |
Default |
|
SelectionSummary |
Selection summary |
Default |
|
StopDetails |
Stopping criterion details |
Default |
|
StopReason |
Reason why selection stopped |
Default |
|
Timing |
Timing details |
||
TPFSplineDeatils |
Truncated power function spline basis details |
DETAILS |
Since GLMselect can make a fair number of tables I am not going to guess which one you want. If you wanted the SelectedEffects you would use something like
ods output SelectedEffects=myeffectsset;
For each output table.
Thank you so much. Very helpful manual.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.