<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Finalizing the publication-style report by using proc report efforts in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finalizing-the-publication-style-report-by-using-proc-report/m-p/739398#M230772</link>
    <description>&lt;P&gt;Hi all SAS Users,&lt;/P&gt;
&lt;P&gt;By searching, asking, consulting you, now I may go to the final step of getting the code for publication-style report. I hope this discussion also benefits other people who want to convert from STATA code to SAS code totally.&lt;/P&gt;
&lt;P&gt;The last code working well so far is:&lt;/P&gt;
&lt;P&gt;Input:parm.xls (I also attach the excel file in this post)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_0-1620278369510.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59082i1E1C7862DDCB8D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_0-1620278369510.png" alt="Phil_NZ_0-1620278369510.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT OUT= WORK.PARM  DATAFILE= "C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\leniency &amp;amp; operating\test_present\parm.xls"  DBMS=EXCEL REPLACE;
  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','Adj.R-sq','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_,'format','8.4');
        do i=1 to 3;
        if 0.05&amp;lt;cc(i) &amp;lt;= 0.1  then call define(_col_, "style", "style=[ posttext='*']" ); 
        else if 0.01 &amp;lt;cc(i) &amp;lt;=0.05 then call define(_col_, "style", "style=[ posttext='**']" ); 
        else if cc(i) &amp;lt;= 0.01   then call define(_col_, "style", "style=[ posttext='***']" );
		end;
		end;
   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_1-1620278411868.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59083i42D1EB084DB11C2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_1-1620278411868.png" alt="Phil_NZ_1-1620278411868.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;However, &lt;STRONG&gt;it works well only if the three columns have all 6 variables from X1 to X6 and the intercept&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;I have two question here which irritate me:&lt;/P&gt;
&lt;P&gt;1. How can we change the display of "value" in second, third, and fourth column on the Output Table (under Y1,Y2,Y3 respectively) to "aaa", "bbb", "xyz" ?&lt;/P&gt;
&lt;P&gt;2. When I adjust the input by delete X3-X6 associated with dependent Y1, X4-X6 associated with dependent Y2 as the input below:&lt;/P&gt;
&lt;P&gt;input:palmz (I also attached the file)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_2-1620278989700.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59084i04E0E64AB6CA66D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_2-1620278989700.png" alt="Phil_NZ_2-1620278989700.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I run the same code as above and my output is:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_3-1620279043701.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59085i7F3E863A9C20EFD6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_3-1620279043701.png" alt="Phil_NZ_3-1620279043701.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering how can I push the R-square, Adj.R-sqr, and N.Ods to the bottom of the Output Table and how to blank the yellowed cells.&lt;/P&gt;
&lt;P&gt;Many thanks and warmest regards,&lt;/P&gt;
&lt;P&gt;Phil.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 05:51:21 GMT</pubDate>
    <dc:creator>Phil_NZ</dc:creator>
    <dc:date>2021-05-06T05:51:21Z</dc:date>
    <item>
      <title>Finalizing the publication-style report by using proc report efforts</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finalizing-the-publication-style-report-by-using-proc-report/m-p/739398#M230772</link>
      <description>&lt;P&gt;Hi all SAS Users,&lt;/P&gt;
&lt;P&gt;By searching, asking, consulting you, now I may go to the final step of getting the code for publication-style report. I hope this discussion also benefits other people who want to convert from STATA code to SAS code totally.&lt;/P&gt;
&lt;P&gt;The last code working well so far is:&lt;/P&gt;
&lt;P&gt;Input:parm.xls (I also attach the excel file in this post)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_0-1620278369510.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59082i1E1C7862DDCB8D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_0-1620278369510.png" alt="Phil_NZ_0-1620278369510.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT OUT= WORK.PARM  DATAFILE= "C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\leniency &amp;amp; operating\test_present\parm.xls"  DBMS=EXCEL REPLACE;
  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','Adj.R-sq','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_,'format','8.4');
        do i=1 to 3;
        if 0.05&amp;lt;cc(i) &amp;lt;= 0.1  then call define(_col_, "style", "style=[ posttext='*']" ); 
        else if 0.01 &amp;lt;cc(i) &amp;lt;=0.05 then call define(_col_, "style", "style=[ posttext='**']" ); 
        else if cc(i) &amp;lt;= 0.01   then call define(_col_, "style", "style=[ posttext='***']" );
		end;
		end;
   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_1-1620278411868.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59083i42D1EB084DB11C2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_1-1620278411868.png" alt="Phil_NZ_1-1620278411868.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;However, &lt;STRONG&gt;it works well only if the three columns have all 6 variables from X1 to X6 and the intercept&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;I have two question here which irritate me:&lt;/P&gt;
&lt;P&gt;1. How can we change the display of "value" in second, third, and fourth column on the Output Table (under Y1,Y2,Y3 respectively) to "aaa", "bbb", "xyz" ?&lt;/P&gt;
&lt;P&gt;2. When I adjust the input by delete X3-X6 associated with dependent Y1, X4-X6 associated with dependent Y2 as the input below:&lt;/P&gt;
&lt;P&gt;input:palmz (I also attached the file)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_2-1620278989700.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59084i04E0E64AB6CA66D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_2-1620278989700.png" alt="Phil_NZ_2-1620278989700.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I run the same code as above and my output is:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_3-1620279043701.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59085i7F3E863A9C20EFD6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_3-1620279043701.png" alt="Phil_NZ_3-1620279043701.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering how can I push the R-square, Adj.R-sqr, and N.Ods to the bottom of the Output Table and how to blank the yellowed cells.&lt;/P&gt;
&lt;P&gt;Many thanks and warmest regards,&lt;/P&gt;
&lt;P&gt;Phil.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 05:51:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finalizing-the-publication-style-report-by-using-proc-report/m-p/739398#M230772</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-05-06T05:51:21Z</dc:date>
    </item>
  </channel>
</rss>

