BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavyJones
Obsidian | Level 7

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!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

MODEL

Default

AvgParmEst

Average parameter estimates

MODELAVERAGE

Default

BSplineDetails

B-spline basis details

EFFECT

DETAILS

Candidates

Entry/removal effect ranking

MODEL

DETAILS=

ClassLevelCoding

Classification variable coding

CLASS

SHOWCODING

ClassLevelInfo

Classification variable levels

CLASS

Default

CollectionLevelInfo

Levels of collection effects

EFFECT

DETAILS

CVDetails

Cross validation PRESS by fold

MODEL

CVDETAILS=

Dimensions

Number of effects and parameters

MODEL

Default

EffectSelectPct

Effect selection percentages

MODELAVERAGE

Default

FitStatistics

Selected model fit statistics

MODEL

Default

MMLevelInfo

Levels of multimember effects

EFFECT

DETAILS

ModelAvgInfo

Model averaging information

MODELAVERAGE

Default

ModelInfo

Model information

MODEL

Default

ModelSelectFreq

Model selection frequencies

MODELAVERAGE

Default

NObs

Number of observations

MODEL

Default

ParameterNames

Labels for column names in the design matrix

PROC

OUTDESIGN(names)

ParameterEstimates

Selected model parameter estimates

MODEL

Default

PerfSettings

Performance settings

PERFORMANCE

DETAILS

PolynomialDetails

Polynomial details

EFFECT

DETAILS

PolynomialScaling

Polynomial scaling

EFFECT

DETAILS

RefitAvgParmEst

Refit average parameter estimates

MODELAVERAGE

REFIT

ScoreInfo

Score request information

SCORE

Default

SelectedEffects

List of selected effects

MODEL

Default

SelectionSummary

Selection summary

MODEL

Default

StopDetails

Stopping criterion details

MODEL

Default

StopReason

Reason why selection stopped

MODEL

Default

Timing

Timing details

PERFORMANCE

DETAILS

TPFSplineDeatils

Truncated power function spline basis details

EFFECT

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.

View solution in original post

4 REPLIES 4
ballardw
Super User

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

MODEL

Default

AvgParmEst

Average parameter estimates

MODELAVERAGE

Default

BSplineDetails

B-spline basis details

EFFECT

DETAILS

Candidates

Entry/removal effect ranking

MODEL

DETAILS=

ClassLevelCoding

Classification variable coding

CLASS

SHOWCODING

ClassLevelInfo

Classification variable levels

CLASS

Default

CollectionLevelInfo

Levels of collection effects

EFFECT

DETAILS

CVDetails

Cross validation PRESS by fold

MODEL

CVDETAILS=

Dimensions

Number of effects and parameters

MODEL

Default

EffectSelectPct

Effect selection percentages

MODELAVERAGE

Default

FitStatistics

Selected model fit statistics

MODEL

Default

MMLevelInfo

Levels of multimember effects

EFFECT

DETAILS

ModelAvgInfo

Model averaging information

MODELAVERAGE

Default

ModelInfo

Model information

MODEL

Default

ModelSelectFreq

Model selection frequencies

MODELAVERAGE

Default

NObs

Number of observations

MODEL

Default

ParameterNames

Labels for column names in the design matrix

PROC

OUTDESIGN(names)

ParameterEstimates

Selected model parameter estimates

MODEL

Default

PerfSettings

Performance settings

PERFORMANCE

DETAILS

PolynomialDetails

Polynomial details

EFFECT

DETAILS

PolynomialScaling

Polynomial scaling

EFFECT

DETAILS

RefitAvgParmEst

Refit average parameter estimates

MODELAVERAGE

REFIT

ScoreInfo

Score request information

SCORE

Default

SelectedEffects

List of selected effects

MODEL

Default

SelectionSummary

Selection summary

MODEL

Default

StopDetails

Stopping criterion details

MODEL

Default

StopReason

Reason why selection stopped

MODEL

Default

Timing

Timing details

PERFORMANCE

DETAILS

TPFSplineDeatils

Truncated power function spline basis details

EFFECT

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.

DavyJones
Obsidian | Level 7
Thanks!
DavyJones
Obsidian | Level 7

Thank you so much. Very helpful manual.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1708 views
  • 2 likes
  • 3 in conversation