如何从 Proc Univariate 中清除 "Results" 以仅显示特定的 table

How to clear "Results" from Proc Univariate to show only a specific table

我一直在使用 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;

在 运行 之前的代码之后,我得到了 "Results",它为我提供了直方图图形和其他有关测试的描述性信息。我正在寻找一种方法来使此 "Results" 打印仅显示与最后一行添加的 "proc print" 相对应的最后部分。

提前致谢!

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

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 是您为其分配的名称。)