2017-05-13 1 views
0

STATA는 하나의 테이블에 여러 회귀를보고하는 멋진 코드 esttab을 가지고 있습니다. 각 열은 회귀이며 각 행은 변수입니다. SAS가 동일한 작업을 수행 할 수 있습니까? 나는 다음과 같이 SAS에서만 뭔가를 얻을 수 있습니다. 그러나, 테이블은 esttab만큼 아름답 지 않습니다.SAS는 STATA esttab으로 할 수 있습니까?

미리 감사드립니다.

data error; 
input Y X1 X2 X3 ; 
datalines; 
4 5 6 7 
6 6 5 9 
9 8 8 8 
10 10 2 1 
4 4 2 2 
6 8 3 5 
4 4 6 7 
7 9 8 8 
8 8 5 5 
7 5 6 7 
9 8 9 8 
0 2 5 8 
6 6 8 7 
1 2 5 4 
5 6 5 8 
6 6 8 9 
7 7 8 2 
5 5 8 2 
5 8 7 8 
run; 
PROC PRINT;RUN; 

    proc reg data=error outest=est tableout alpha=0.1; 
M1: MODEL Y = X1 X2 /noprint; 
M2: MODEL Y = X2 X3 /noprint; 
M3: MODEL Y = X1 X3 /noprint; 
M4: MODEL Y = X1 X2 X3 /noprint; 
    proc print data=est; 
    run; 
+0

'Stata'에서'Esttab'을 사용할 때 출력 스크린 샷을 공유하십시오. 그게 도움이 될거야. –

+0

원하는 출력을 설명하고 PROC REG에서 얻은 결과와 다른 점을 설명하십시오. – Quentin

답변

0

저는 Stata을 사용하지 않았지만 프로젝트의 일부로 알고 있습니다. 불행히도 SAS을 사용하여이를 수행하는 좋은 방법은 없습니다. 최신 출력을 얻으려면 Tagsets을 설치하고 사용해보십시오. 이 경우 excltags.tpl이 도움이됩니다.

처럼,

ods path work.tmplmst(update) ; 
filename tagset url 'http://support.sas.com/rnd/base/ods/odsmarkup/excltags.tpl'; 
%include tagset; 

은 위 Tagsets를 설치하고 Work에서 동일한 저장합니다. 이렇게하면 시스템에 이미 설치된 태그 세트가 중단되지 않습니다. 또한이 단계는 새로운 SAS 세션을 열 때마다 수행해야합니다.

ods listing close; 
    ods tagsets.ExcelXP file='Excelxp.xml'; 
#Your Code# 
    proc reg data=error outest=est tableout alpha=0.1; 
    M1: MODEL Y = X1 X2 /noprint; 
    M2: MODEL Y = X2 X3 /noprint; 
    M3: MODEL Y = X1 X3 /noprint; 
    M4: MODEL Y = X1 X2 X3 /noprint; 
    proc print data=est; 
    run; 
#Your Code# 
    ods tagsets.ExcelXP close; 

나는 내 홈 바탕 화면에 현재 오전는 SAS를 설치하고 나는 그것을 시도 주어진 적이 없다 필요 없다. 이것은 회귀의 결과를 계수, 유의 수준 등을 포함하는 테이블로 Excel로 내 보내야합니다.

이 기능이 작동하는지 알려주세요. 또한 자세한 내용은 Document을 참조하십시오.

+0

감사합니다 @ Praneeth 쿠마. 당신은 저에게 영감을줍니다. 나는 그 퀘스트에 대한 답을 찾은 것 같습니다. –

0

Praneeth Kumar의 영감에 감사드립니다. 관련 정보를 찾았습니다. http://stats.idre.ucla.edu/sas/code/ummary-table-for-multiple-regression-models/

필자의 요구에 맞게 변경했습니다.

/*1*//*set the formation*/ 
proc format;   
    picture stderrf (round)  
     low-high=' 9.9999)' (prefix='(')         
      .=' ';             
run; 
/*2*//*run the several regressions and turn the results to a dataset*/ 
ods output ParameterEstimates (persist)=t;      
PROC REG DATA=error; 
M1: MODEL Y = X1 X2 ; 
M2: MODEL Y = X2 X3 ; 
M3: MODEL Y = X1 X3  ; 
M4: MODEL Y = X1 X2 X3 ; 
run;                 
ods output close;             

proc print data=t;             
run; 
    /*3*//*use the formation and the dataset change into a table*/ 
proc tabulate data=t noseps;  
    class model variable;      
    var estimate Probt;  
    table variable=''*(estimate =' '*sum=' '       
        Probt=' '*sum=' '*F=stderrf.),     
     model=' '             
     /box=[label="Parameter"] rts=15 row=float misstext=' '; 
run;