【问题标题】:How to clear "Results" from Proc Univariate to show only a specific table如何从 Proc Univariate 中清除“结果”以仅显示特定表
【发布时间】:2018-02-02 13:23:56
【问题描述】:

我一直在使用 UNIVARIATE 程序从一系列分布(对数正态、指数、伽马)中获取 p 值,并遇到了以下问题:

我正在使用以下代码来获取每个分布的拟合优度检验的 p 值:

ods select all/*ParameterEstimates GoodnessOfFit*/;
proc univariate data=results.Parametros_Prueba_1;
      var Monto_1.;
      histogram /
      lognormal (l=1  color=red SHAPE=&ParamLOGN2_1  SCALE=&ParamLOGN1_1)
      gamma (l=1  color=red    SHAPE=&ParamGAM1_1 SCALE=&ParamGAM2_1)
      exponential   (l=2 SCALE=&ParamEXP1_1);
ods output GoodnessOfFit=results.Goodness_1;
run;

proc print data=results.Goodness_1;

运行前面的代码后,我得到“结果”,它为我提供了直方图图形和有关测试的其他描述性信息。我正在寻找一种方法来让这个“结果”打印只显示与最后一行添加的“proc print”相对应的最后一部分。

提前致谢!

【问题讨论】:

  • ODS SELECT 是标准方法,但我看到您已将这部分注释掉,所以我们可以假设这不起作用吗?
  • 嗨@Reeza!是的,不幸的是,它为每个分布提供了分区的数据。另一方面,“GoodnessOfFit”表给出了这些表的摘要......

标签: sas statistics distribution resultset proc


【解决方案1】:

如果您不想从PROC UNIVARIATE 向屏幕(结果窗口)输出,那么最简单的答案是:

ods select none;
proc univariate ... ;
run;
ods select all;
proc print ... ;
run;

ods select none; 告诉 ODS 不要进行任何 ODS 输出。你仍然会得到你的 ODS OUTPUT,因为它会在之后出现。

ods select none;
proc univariate data=sashelp.class;
  var height;
      histogram name='univhist' /
      lognormal (l=1  color=red  )
      gamma (l=1  color=red    )
      exponential   (l=2  );
ods output GoodnessOfFit=Goodness_1;
run;
ods select all;
proc print data=Goodness_1;
run;

现在,您会注意到您没有得到直方图;那个更难。不幸的是,每次你运行它时它都会改变它的名字,即使你使用 NAME= 选项,它也只会在它第一次运行时起作用。您需要使用PROC GREPLAY 删除它。

proc greplay nofs igout=work.gseg;
  delete 'univhist';
run; quit;

(假设UNIVHIST 是您为其指定的名称。)

【讨论】:

  • 谢谢乔!做到了!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-03-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多