如何查看我的 proc 中可用的输出选项? [英] How do I see what output options are available in my proc?

查看:38
本文介绍了如何查看我的 proc 中可用的输出选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行复杂的过程,例如 PROC REGPROC GLM,通常会在输出窗口中生成描述回归结果的表格,除了使用 OUTOUTPUT 选项生成的输出数据集.

Running complex procs such as PROC REG or PROC GLM, there are often tables that are produced in the output window describing the results of the regression, in addition to the output datasets produced using OUT or OUTPUT options.

如何将这些表输出到 SAS 数据集?

How can I output those tables to SAS datasets?

例如,给出 PROC REG 中的第一个 SAS 示例(在 文档页面),如何输出拟合优度统计数据(例如 R-Squared)?

For example, given the first SAS example in PROC REG (on the documentation page), how can I output the Goodness of Fit Statistics (such as the R-Squared)?

推荐答案

为了识别可能的输出数据集,SAS 提供了 ods trace 语句.这要求 SAS 将它写入输出的每个数据表的名称(和一些详细信息)写入日志.在大多数情况下,这可以通过 ods 输出.

In order to identify possible output datasets, SAS provides the ods trace statement. This asks SAS to write to the log the name (and some details) of each data table it writes to the output. In most cases, this can be saved to a dataset via ods output.

例如,在问题中提到的 SAS 示例中,您可以这样写:

For example, in the SAS example referred to in the question, you could write:

ods trace on; 
    proc reg data=baseball;
       id name team league;
       model logSalary = no_hits no_runs no_rbi no_bb yr_major cr_hits;
    run;
ods trace off;

这会在日志中报告FitStatistics"是您想要的输出对象的名称.然后你写:

That would report in the log that "FitStatistics" is the name of the output object you want. Then you write:

ods output FitStatistics=fitds;
proc reg data=baseball;
   id name team league;
   model logSalary = no_hits no_runs no_rbi no_bb yr_major cr_hits;
run;

它会输出fitds数据集.

ODS Trace 当然仅用于确定表的名称 - 一旦您知道所需的表的名称,您可以简单地使用该名称和 ods output 在未来.

ODS Trace is only needed for the purpose of determining the name of the table of course - once you know the name of the table you need, you can simply use that name with ods output in the future.

您也经常可以在文档中找到表名列表;例如,PROC REG 将它们放在 这里.

You also frequently can find the list of the table names in the documentation; for example, PROC REG places them here.

ODS 输出可以放在 run 语句之前的任何位置(因为它是一个全局语句);一个常见的位置是在 run 之前.我个人更喜欢把它放在 proc 之前,因为它是一个全局声明,但是 有人不同意这种方法.

ODS Output may be placed any location before the run statement (as it is a global statement); a common location is immediately before run. My personal preference is to put it before the proc as it is a global statement, but there is some disagreement with that approach.

这篇关于如何查看我的 proc 中可用的输出选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆