<?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 Re: Creating STATA like output in SAS regs, e.g. t-stats below coefficient in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-STATA-like-output-in-SAS-regs-e-g-t-stats-below/m-p/21193#M3865</link>
    <description>Hi:&lt;BR /&gt;
  Consider the following code from PROC REG:&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods trace on /label listing;&lt;BR /&gt;
proc reg data=sashelp.class;&lt;BR /&gt;
  model age=height;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
ods trace off;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                                 &lt;BR /&gt;
It creates 4 output objects, as identified in the LISTING output (Each output object starts with the line "Output Added"):&lt;BR /&gt;
[pre]&lt;BR /&gt;
The REG Procedure&lt;BR /&gt;
Model: MODEL1&lt;BR /&gt;
Dependent Variable: Age&lt;BR /&gt;
                          &lt;BR /&gt;
Output Added:&lt;BR /&gt;
-------------&lt;BR /&gt;
Name:       NObs&lt;BR /&gt;
Label:      Number of Observations&lt;BR /&gt;
Template:   Stat.Reg.NObs&lt;BR /&gt;
Path:       Reg.MODEL1.Fit.Age.NObs&lt;BR /&gt;
Label Path: 'The Reg Procedure'.'MODEL1'.'Fit'.Age.'Number of Observations'&lt;BR /&gt;
-------------&lt;BR /&gt;
                                  &lt;BR /&gt;
                               &lt;BR /&gt;
Number of Observations Read          19&lt;BR /&gt;
Number of Observations Used          19&lt;BR /&gt;
                      &lt;BR /&gt;
Output Added:&lt;BR /&gt;
-------------&lt;BR /&gt;
Name:       ANOVA&lt;BR /&gt;
Label:      Analysis of Variance&lt;BR /&gt;
Template:   Stat.REG.ANOVA&lt;BR /&gt;
Path:       Reg.MODEL1.Fit.Age.ANOVA&lt;BR /&gt;
Label Path: 'The Reg Procedure'.'MODEL1'.'Fit'.Age.'Analysis of Variance'&lt;BR /&gt;
-------------&lt;BR /&gt;
                           &lt;BR /&gt;
                          &lt;BR /&gt;
                             Analysis of Variance&lt;BR /&gt;
                           &lt;BR /&gt;
                                    Sum of           Mean&lt;BR /&gt;
Source                   DF        Squares         Square    F Value    Pr &amp;gt; F&lt;BR /&gt;
                     &lt;BR /&gt;
Model                     1       26.40634       26.40634      32.77    &amp;lt;.0001&lt;BR /&gt;
Error                    17       13.69893        0.80582&lt;BR /&gt;
Corrected Total          18       40.10526&lt;BR /&gt;
                 &lt;BR /&gt;
Output Added:&lt;BR /&gt;
-------------&lt;BR /&gt;
Name:       FitStatistics&lt;BR /&gt;
Label:      Fit Statistics&lt;BR /&gt;
Template:   Stat.REG.FitStatistics&lt;BR /&gt;
Path:       Reg.MODEL1.Fit.Age.FitStatistics&lt;BR /&gt;
Label Path: 'The Reg Procedure'.'MODEL1'.'Fit'.Age.'Fit Statistics'&lt;BR /&gt;
-------------&lt;BR /&gt;
                          &lt;BR /&gt;
                       &lt;BR /&gt;
Root MSE              0.89767    R-Square     0.6584&lt;BR /&gt;
Dependent Mean       13.31579    Adj R-Sq     0.6383&lt;BR /&gt;
Coeff Var             6.74143&lt;BR /&gt;
                          &lt;BR /&gt;
Output Added:&lt;BR /&gt;
-------------&lt;BR /&gt;
Name:       ParameterEstimates&lt;BR /&gt;
Label:      Parameter Estimates&lt;BR /&gt;
Template:   Stat.REG.ParameterEstimates&lt;BR /&gt;
Path:       Reg.MODEL1.Fit.Age.ParameterEstimates&lt;BR /&gt;
Label Path: 'The Reg Procedure'.'MODEL1'.'Fit'.Age.'Parameter Estimates'&lt;BR /&gt;
-------------&lt;BR /&gt;
                      &lt;BR /&gt;
                  &lt;BR /&gt;
                        Parameter Estimates&lt;BR /&gt;
                     &lt;BR /&gt;
                     Parameter       Standard&lt;BR /&gt;
Variable     DF       Estimate          Error    t Value    Pr &amp;gt; |t|&lt;BR /&gt;
                       &lt;BR /&gt;
Intercept     1       -1.41049        2.58074      -0.55      0.5918&lt;BR /&gt;
Height        1        0.23624        0.04127       5.72      &amp;lt;.0001&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                &lt;BR /&gt;
So which 2 numbers from the above output would you want to have "stacked" together. Given that the PROC REG output is coming from 4 separate output objects, what you want to do is possible, but would require that you do something like this:&lt;BR /&gt;
1) capture your output object(s) of interest in a dataset&lt;BR /&gt;
2) take the numbers (variables) you want out of each output object&lt;BR /&gt;
3a) create a new variable from the 2 variables of interest with a carriage return or line feed between them and then use PROC PRINT or PROC REPORT on this new dataset with the new variable&lt;BR /&gt;
 &lt;BR /&gt;
OR&lt;BR /&gt;
   &lt;BR /&gt;
3b) create a new table template to use with the data from #2 and code the new table template to stack the 2 variables of interest. Then invoke the new table template with a DATA step program.&lt;BR /&gt;
&lt;BR /&gt;
The creation of this type of output is not specific to any destination....but you would be using features of ODS, such as ODS OUTPUT for #1, ODS ESCAPECHAR in #3a or ODS Table templates in #3b. Once your information was captured and your new data with the parentheses around the t stat was ready to go, you could send your output to any destination that supported the technique that you had chosen.&lt;BR /&gt;
 &lt;BR /&gt;
But it's still not clear to me WHICH 2 numbers from the REG output you would want to see stacked. So consider this other example, that stacks 2 numbers taken from 1 output object in PROC MEANS. The name of the output object for PROC MEANS is BASE.SUMMARY, so first, the program creates an output dataset using ODS OUTPUT. Then the output dataset is passed to PROC REPORT, where the parentheses are added around the HEIGHT_MAX variable and concatenated with the HEIGHT_MIN variable in order to make the character variable NEWVAR (which has a carriage return or line feed between the 2 pieces of information).&lt;BR /&gt;
 &lt;BR /&gt;
As you can see, getting information from the SAME output object is a bit simpler than getting information from 2 different output objects. so what you want do do will be a bit more complicated than what is shown in the program below.&lt;BR /&gt;
  &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods output summary=work.mnout;&lt;BR /&gt;
proc means data=sashelp.class nway min max;&lt;BR /&gt;
var height;&lt;BR /&gt;
class age;&lt;BR /&gt;
run;&lt;BR /&gt;
                      &lt;BR /&gt;
proc print data=mnout;&lt;BR /&gt;
run;&lt;BR /&gt;
                    &lt;BR /&gt;
ods html file='c:\temp\useReport.html' style=sasweb;&lt;BR /&gt;
ods escapechar='~';&lt;BR /&gt;
proc report data=mnout nowd split='/';&lt;BR /&gt;
  title 'Using PROC REPORT';&lt;BR /&gt;
  column age nobs height_min height_max newvar;&lt;BR /&gt;
  define age / order;&lt;BR /&gt;
  define nobs / sum;&lt;BR /&gt;
  define height_min / display noprint;&lt;BR /&gt;
  define height_max / display noprint;&lt;BR /&gt;
  define newvar / computed 'Based on: Height/Min/(Max)'&lt;BR /&gt;
         style(column)={just=r};&lt;BR /&gt;
  compute newvar / character length=30;&lt;BR /&gt;
    newvar = catt(put(height_min,4.1),'~n','(',put(height_max,6.2),')');&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
title;&lt;BR /&gt;
[/pre]</description>
    <pubDate>Mon, 25 Oct 2010 15:05:23 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-10-25T15:05:23Z</dc:date>
    <item>
      <title>Creating STATA like output in SAS regs, e.g. t-stats below coefficient</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-STATA-like-output-in-SAS-regs-e-g-t-stats-below/m-p/21191#M3863</link>
      <description>Dear all,&lt;BR /&gt;
&lt;BR /&gt;
It's a question i have been researching for a while. Is there a way to program or code in SAS maybe through excel tagset or through ODS to output t stats in parenthesis below coefficient estimates in a regression table like in STATA? as in below:&lt;BR /&gt;
&lt;BR /&gt;
Regression of ETFs tracking Dow Jones Industrial Average Index	&lt;BR /&gt;
	2007 - 2010&lt;BR /&gt;
	&lt;BR /&gt;
Variables	      Dow Jones Daily Ret &amp;lt;--- dependent variable&lt;BR /&gt;
DIA Flow	           0.00302   &amp;lt;--- coeff estimate&lt;BR /&gt;
            tstat  ----&amp;gt;  (0.145)    &lt;BR /&gt;
Ideally i would also look for the same structure in other tables, e.g. correlation tables.&lt;BR /&gt;
&lt;BR /&gt;
Thank you in advance,&lt;BR /&gt;
&lt;BR /&gt;
Arsenio</description>
      <pubDate>Fri, 22 Oct 2010 23:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-STATA-like-output-in-SAS-regs-e-g-t-stats-below/m-p/21191#M3863</guid>
      <dc:creator>Arsenio_Staer</dc:creator>
      <dc:date>2010-10-22T23:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating STATA like output in SAS regs, e.g. t-stats below coefficient</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-STATA-like-output-in-SAS-regs-e-g-t-stats-below/m-p/21192#M3864</link>
      <description>Suggest you re-post in a more appropriate Statistics forum.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Sat, 23 Oct 2010 03:56:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-STATA-like-output-in-SAS-regs-e-g-t-stats-below/m-p/21192#M3864</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-10-23T03:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating STATA like output in SAS regs, e.g. t-stats below coefficient</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-STATA-like-output-in-SAS-regs-e-g-t-stats-below/m-p/21193#M3865</link>
      <description>Hi:&lt;BR /&gt;
  Consider the following code from PROC REG:&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods trace on /label listing;&lt;BR /&gt;
proc reg data=sashelp.class;&lt;BR /&gt;
  model age=height;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
ods trace off;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                                 &lt;BR /&gt;
It creates 4 output objects, as identified in the LISTING output (Each output object starts with the line "Output Added"):&lt;BR /&gt;
[pre]&lt;BR /&gt;
The REG Procedure&lt;BR /&gt;
Model: MODEL1&lt;BR /&gt;
Dependent Variable: Age&lt;BR /&gt;
                          &lt;BR /&gt;
Output Added:&lt;BR /&gt;
-------------&lt;BR /&gt;
Name:       NObs&lt;BR /&gt;
Label:      Number of Observations&lt;BR /&gt;
Template:   Stat.Reg.NObs&lt;BR /&gt;
Path:       Reg.MODEL1.Fit.Age.NObs&lt;BR /&gt;
Label Path: 'The Reg Procedure'.'MODEL1'.'Fit'.Age.'Number of Observations'&lt;BR /&gt;
-------------&lt;BR /&gt;
                                  &lt;BR /&gt;
                               &lt;BR /&gt;
Number of Observations Read          19&lt;BR /&gt;
Number of Observations Used          19&lt;BR /&gt;
                      &lt;BR /&gt;
Output Added:&lt;BR /&gt;
-------------&lt;BR /&gt;
Name:       ANOVA&lt;BR /&gt;
Label:      Analysis of Variance&lt;BR /&gt;
Template:   Stat.REG.ANOVA&lt;BR /&gt;
Path:       Reg.MODEL1.Fit.Age.ANOVA&lt;BR /&gt;
Label Path: 'The Reg Procedure'.'MODEL1'.'Fit'.Age.'Analysis of Variance'&lt;BR /&gt;
-------------&lt;BR /&gt;
                           &lt;BR /&gt;
                          &lt;BR /&gt;
                             Analysis of Variance&lt;BR /&gt;
                           &lt;BR /&gt;
                                    Sum of           Mean&lt;BR /&gt;
Source                   DF        Squares         Square    F Value    Pr &amp;gt; F&lt;BR /&gt;
                     &lt;BR /&gt;
Model                     1       26.40634       26.40634      32.77    &amp;lt;.0001&lt;BR /&gt;
Error                    17       13.69893        0.80582&lt;BR /&gt;
Corrected Total          18       40.10526&lt;BR /&gt;
                 &lt;BR /&gt;
Output Added:&lt;BR /&gt;
-------------&lt;BR /&gt;
Name:       FitStatistics&lt;BR /&gt;
Label:      Fit Statistics&lt;BR /&gt;
Template:   Stat.REG.FitStatistics&lt;BR /&gt;
Path:       Reg.MODEL1.Fit.Age.FitStatistics&lt;BR /&gt;
Label Path: 'The Reg Procedure'.'MODEL1'.'Fit'.Age.'Fit Statistics'&lt;BR /&gt;
-------------&lt;BR /&gt;
                          &lt;BR /&gt;
                       &lt;BR /&gt;
Root MSE              0.89767    R-Square     0.6584&lt;BR /&gt;
Dependent Mean       13.31579    Adj R-Sq     0.6383&lt;BR /&gt;
Coeff Var             6.74143&lt;BR /&gt;
                          &lt;BR /&gt;
Output Added:&lt;BR /&gt;
-------------&lt;BR /&gt;
Name:       ParameterEstimates&lt;BR /&gt;
Label:      Parameter Estimates&lt;BR /&gt;
Template:   Stat.REG.ParameterEstimates&lt;BR /&gt;
Path:       Reg.MODEL1.Fit.Age.ParameterEstimates&lt;BR /&gt;
Label Path: 'The Reg Procedure'.'MODEL1'.'Fit'.Age.'Parameter Estimates'&lt;BR /&gt;
-------------&lt;BR /&gt;
                      &lt;BR /&gt;
                  &lt;BR /&gt;
                        Parameter Estimates&lt;BR /&gt;
                     &lt;BR /&gt;
                     Parameter       Standard&lt;BR /&gt;
Variable     DF       Estimate          Error    t Value    Pr &amp;gt; |t|&lt;BR /&gt;
                       &lt;BR /&gt;
Intercept     1       -1.41049        2.58074      -0.55      0.5918&lt;BR /&gt;
Height        1        0.23624        0.04127       5.72      &amp;lt;.0001&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                &lt;BR /&gt;
So which 2 numbers from the above output would you want to have "stacked" together. Given that the PROC REG output is coming from 4 separate output objects, what you want to do is possible, but would require that you do something like this:&lt;BR /&gt;
1) capture your output object(s) of interest in a dataset&lt;BR /&gt;
2) take the numbers (variables) you want out of each output object&lt;BR /&gt;
3a) create a new variable from the 2 variables of interest with a carriage return or line feed between them and then use PROC PRINT or PROC REPORT on this new dataset with the new variable&lt;BR /&gt;
 &lt;BR /&gt;
OR&lt;BR /&gt;
   &lt;BR /&gt;
3b) create a new table template to use with the data from #2 and code the new table template to stack the 2 variables of interest. Then invoke the new table template with a DATA step program.&lt;BR /&gt;
&lt;BR /&gt;
The creation of this type of output is not specific to any destination....but you would be using features of ODS, such as ODS OUTPUT for #1, ODS ESCAPECHAR in #3a or ODS Table templates in #3b. Once your information was captured and your new data with the parentheses around the t stat was ready to go, you could send your output to any destination that supported the technique that you had chosen.&lt;BR /&gt;
 &lt;BR /&gt;
But it's still not clear to me WHICH 2 numbers from the REG output you would want to see stacked. So consider this other example, that stacks 2 numbers taken from 1 output object in PROC MEANS. The name of the output object for PROC MEANS is BASE.SUMMARY, so first, the program creates an output dataset using ODS OUTPUT. Then the output dataset is passed to PROC REPORT, where the parentheses are added around the HEIGHT_MAX variable and concatenated with the HEIGHT_MIN variable in order to make the character variable NEWVAR (which has a carriage return or line feed between the 2 pieces of information).&lt;BR /&gt;
 &lt;BR /&gt;
As you can see, getting information from the SAME output object is a bit simpler than getting information from 2 different output objects. so what you want do do will be a bit more complicated than what is shown in the program below.&lt;BR /&gt;
  &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods output summary=work.mnout;&lt;BR /&gt;
proc means data=sashelp.class nway min max;&lt;BR /&gt;
var height;&lt;BR /&gt;
class age;&lt;BR /&gt;
run;&lt;BR /&gt;
                      &lt;BR /&gt;
proc print data=mnout;&lt;BR /&gt;
run;&lt;BR /&gt;
                    &lt;BR /&gt;
ods html file='c:\temp\useReport.html' style=sasweb;&lt;BR /&gt;
ods escapechar='~';&lt;BR /&gt;
proc report data=mnout nowd split='/';&lt;BR /&gt;
  title 'Using PROC REPORT';&lt;BR /&gt;
  column age nobs height_min height_max newvar;&lt;BR /&gt;
  define age / order;&lt;BR /&gt;
  define nobs / sum;&lt;BR /&gt;
  define height_min / display noprint;&lt;BR /&gt;
  define height_max / display noprint;&lt;BR /&gt;
  define newvar / computed 'Based on: Height/Min/(Max)'&lt;BR /&gt;
         style(column)={just=r};&lt;BR /&gt;
  compute newvar / character length=30;&lt;BR /&gt;
    newvar = catt(put(height_min,4.1),'~n','(',put(height_max,6.2),')');&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
title;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 25 Oct 2010 15:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-STATA-like-output-in-SAS-regs-e-g-t-stats-below/m-p/21193#M3865</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-25T15:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating STATA like output in SAS regs, e.g. t-stats below coefficient</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-STATA-like-output-in-SAS-regs-e-g-t-stats-below/m-p/21194#M3866</link>
      <description>Thank you for the answer Cynthia,&lt;BR /&gt;
&lt;BR /&gt;
I planned to have estimates t stats from the regression model as the value in parenthesis below the parameter estimates :&lt;BR /&gt;
&lt;BR /&gt;
                &lt;BR /&gt;
                        Parameter Estimates&lt;BR /&gt;
                     &lt;BR /&gt;
                     Parameter       Standard&lt;BR /&gt;
Variable     DF       Estimate          Error    t Value    Pr &amp;gt; |t|&lt;BR /&gt;
                       &lt;BR /&gt;
Intercept     1       -1.41049        2.58074      -0.55      0.5918&lt;BR /&gt;
Height        1        0.23624        0.04127       5.72      &amp;lt;.0001&lt;BR /&gt;
&lt;BR /&gt;
I will analyze the code you posted and extract the t stats from ParameterEstimates and join them in the ODS table output using the escape char code snippet you provided in the end. It should work. &lt;BR /&gt;
&lt;BR /&gt;
A small question: how would you put that value in the parenthesis ( in your example height_max) on the next row when you ods output to excel using tagsets? So that the height_min is on the row 2 and height_max is on the row 3 in excel file? For now, outputting the results to excel, puts in the same row and consequently in the same cell.&lt;BR /&gt;
&lt;BR /&gt;
Thank you!&lt;BR /&gt;
&lt;BR /&gt;
Arsenio</description>
      <pubDate>Tue, 26 Oct 2010 02:04:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-STATA-like-output-in-SAS-regs-e-g-t-stats-below/m-p/21194#M3866</guid>
      <dc:creator>Arsenio_Staer</dc:creator>
      <dc:date>2010-10-26T02:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating STATA like output in SAS regs, e.g. t-stats below coefficient</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-STATA-like-output-in-SAS-regs-e-g-t-stats-below/m-p/21195#M3867</link>
      <description>Hi:&lt;BR /&gt;
  Well, if you want your statistic in a separate cell, then you have a slightly different challenge. If I were dealing with just PROC MEANS output, I wouldn't use the ODS ESCAPECHAR trick at all (which as you noted, actually does stack the 2 statistics together in one cell).   Instead, I would "transpose" the data and then use PROC REPORT.&lt;BR /&gt;
&lt;BR /&gt;
  Here's the PROC MEANS example using TRANSPOSE and a PICTURE format and PROC REPORT to get parentheses around Height_Max (and only Height_Max).&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods output summary=work.mnout;&lt;BR /&gt;
proc means data=sashelp.class nway min max;&lt;BR /&gt;
var height;&lt;BR /&gt;
class age;&lt;BR /&gt;
run;&lt;BR /&gt;
                 &lt;BR /&gt;
proc transpose data=work.mnout out=work.trout;&lt;BR /&gt;
by age;&lt;BR /&gt;
run;&lt;BR /&gt;
                   &lt;BR /&gt;
proc print data=work.trout;&lt;BR /&gt;
  title 'After Transpose, what are variables';&lt;BR /&gt;
run;&lt;BR /&gt;
                  &lt;BR /&gt;
** create a picture format to add parentheses.;&lt;BR /&gt;
** could also create a character variable with parentheses, instead.; &lt;BR /&gt;
proc format;&lt;BR /&gt;
  picture paren low-high='00099.99)' (prefix='(');&lt;BR /&gt;
run;&lt;BR /&gt;
                                  &lt;BR /&gt;
ods html file='c:\temp\transposed.html' style=sasweb;&lt;BR /&gt;
proc report data=work.trout nowd;&lt;BR /&gt;
  title 'PROC REPORT with CALL DEFINE puts parens around Max';&lt;BR /&gt;
  column age _label_ col1;&lt;BR /&gt;
  define age /order order=data 'Age';&lt;BR /&gt;
  define _label_ / order order=data 'Statistic';&lt;BR /&gt;
  define col1 / display 'Value';&lt;BR /&gt;
  compute col1;&lt;BR /&gt;
     if _label_ = 'Maximum' then do;&lt;BR /&gt;
       call define (_col_,'format','paren.');&lt;BR /&gt;
     end;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
   &lt;BR /&gt;
  Remember that SAS, when it makes a tabular report, generally wants every report row to have the same number of columns, so for example, if I was doing a report on SASHELP.CLASS, it would not be a "normal" tabular report for me to have NAME, AGE and HEIGHT on 1 report row and to have WEIGHT underneath HEIGHT or WEIGHT underneath AGE on the next report row.&lt;BR /&gt;
 &lt;BR /&gt;
  So, if you do capture the output from PROC REG into 2 different datasets, you will then have to bring those datasets together in a way that makes sense. For example, this code:&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods output fitstatistics=work.fs&lt;BR /&gt;
           parameterestimates=work.pe;&lt;BR /&gt;
proc reg data=sashelp.class;&lt;BR /&gt;
model age=height;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
            &lt;BR /&gt;
proc print data=work.fs;&lt;BR /&gt;
  title 'Fit Statistics Stored in Dataset';&lt;BR /&gt;
run;&lt;BR /&gt;
                &lt;BR /&gt;
proc print data=work.pe;&lt;BR /&gt;
  title 'Parameter Estimates Stored in Dataset';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                &lt;BR /&gt;
creates these 2 output datasets, WORK.FS and WORK.PE, as shown below:&lt;BR /&gt;
[pre]&lt;BR /&gt;
*** *** *** WORK.FS *** *** ***&lt;BR /&gt;
Fit Statistics Stored in Dataset&lt;BR /&gt;
                         &lt;BR /&gt;
Obs    Model     Dependent    Label1            cValue1          nValue1     Label2     cValue2            nValue2&lt;BR /&gt;
               &lt;BR /&gt;
 1     MODEL1       Age       Root MSE           0.89767        0.897674    R-Square     0.6584           0.658426&lt;BR /&gt;
 2     MODEL1       Age       Dependent Mean    13.31579       13.315789    Adj R-Sq     0.6383           0.638333&lt;BR /&gt;
 3     MODEL1       Age       Coeff Var          6.74143        6.741428                                         0&lt;BR /&gt;
                           &lt;BR /&gt;
                        &lt;BR /&gt;
*** *** *** WORK.PE *** *** ***&lt;BR /&gt;
Parameter Estimates Stored in Dataset&lt;BR /&gt;
                &lt;BR /&gt;
Obs    Model     Dependent    Variable     DF       Estimate         StdErr     tValue     Probt&lt;BR /&gt;
            &lt;BR /&gt;
 1     MODEL1       Age       Intercept     1       -1.41049        2.58074      -0.55    0.5918&lt;BR /&gt;
 2     MODEL1       Age       Height        1        0.23624        0.04127       5.72    &amp;lt;.0001&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                         &lt;BR /&gt;
Important to note is that the 2 datasets have 2 different structures. The Fit Statistics dataset has different column names than the Parameter Estimates dataset.&lt;BR /&gt;
 &lt;BR /&gt;
Again, what you want to achieve is do-able, but you may have to do a bit of data manipulation to get the report layout (report rows and columns) that you want.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 26 Oct 2010 16:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-STATA-like-output-in-SAS-regs-e-g-t-stats-below/m-p/21195#M3867</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-26T16:19:04Z</dc:date>
    </item>
  </channel>
</rss>

