如何使用 SAS 中的 proc 报告调整发布式报告?

问题描述

通过使用 SAS 代码创建具有三个自变量数量相同的回归的报告表,如下所示:

enter image description here

抱歉,因为我没有足够的10个声望,无法直接在此处显示图片

通过这段代码,我准备了数据

PROC IMPORT DBMS=EXCEL REPLACE OUT= WORK.PARM  
    DATAFILE= "C:\Users\pnguyen\OneDrive - Massey University\PhD journey\leniency & operating\test_present\parm.xls";
  RANGE="parm";
  GETNAMES=YES;
  MIXED=NO;
  SCANTEXT=YES;
  USEDATE=YES;
  SCANTIME=YES;
RUN;
/*write a dataset with standard error on the same column of coefficient*/
data parm2;
set parm;
if not missing(stderr) and variable not in ('R-square','Adj.R-sq','N. Obs.') then do; 
  value=estimate;  
  type='coefficient'; 
  output; 
end;
if not missing(stderr) then do;  
  value=stderr;  
  type='stderr' ; 
  output;  
end;
if variable in ('R-square','N. Obs.') then do;  
  value=estimate;  
  type=variable ; 
  output;  
end; 
run;

我用这个代码报告它:

proc format;           
    picture stderrf (round)       
        low-high=' 9.9999)' (prefix='(')                                
            .=' ';                                                  
run;
    
ods html close;
ods html file="c:\temp\MyHTMLfile.htm";;
title;
proc report data=parm2 Nowd  out=temptbl;
*column model numord variable type dependent,value;
column numord variable type dependent,(value);
define numord /group order=data noprint;
define variable / group order=data ' ';
define type / group order=data noprint;
define dependent / across ' ';
define value /analysis sum;

compute value;
  array cc _c5_ _c7_ _c9_ ;
      if type='stderr' then do;
         call define(_col_,'format','stderrf.');
      end;
      else if type='coefficient' then do; 
        call define(_col_,'8.4');
        do i=1 to 3;
          if 0.05<cc(i) <= 0.1  then call define(_col_,"style","style=[ posttext='*']" ); 
          else if 0.01 <cc(i) <=0.05 then call define(_col_,"style=[ posttext='**']" ); 
          else if cc(i) <= 0.01   then call define(_col_,"style=[ posttext='***']" );
        end;
      end;
   endcomp;
run;

结果是:

enter image description here

然而,只有当三个回归具有从 X1 到 X6 的所有 6 个变量和截距时,上面的代码才能很好地工作。

我有两个问题:

  1. 如何将输出表(分别在Y1、Y2、Y3下)第二、三、四列的“value”显示改为“aaa”、“bbb”、“xyz” ?

  2. 当我通过删除与依赖 Y1 关联的 X3-X6、与依赖 Y2 关联的 X4-X6 作为以下输入来调整输入时:

输入:palmz

enter image description here

我想知道如何将 R-square、Adj.R-sqr 和 N.Ods 推到输出表的底部,以及如何将泛黄的单元格清空。

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)