Sample 25390: Create an output data set using ODS with PROC REG
This sample code is ODSREG1 in the SAS® sample library. This sample code demonstrates how to create an output data set using the ODS OUTPUT statement with PROC REG.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
/* This is sample ODSREG1 from the SAS sample library */
title1;
/* Write a HTML file to disk */
ods html file="odsreg1.htm";
data test;
input y x1 x2 x3 by1 by2 $;
if by2='b' then y1=5;
else y1=y;
weight=1/(x1**2);
int=1;
datalines;
10 10 16 22 1 a
17 16 19 12 1 a
13 27 16 19 1 a
17 25 21 15 1 a
14 17 15 13 2 a
18 18 17 16 2 a
31 25 28 19 2 b
28 19 22 21 2 b
33 16 18 20 1 b
31 26 24 22 1 b
19 17 16 15 1 b
22 29 17 15 1 c
24 15 17 22 2 c
16 12 14 18 2 c
27 29 25 24 2 c
16 18 17 13 2 c
;
run;
/* Use the ODS OUTPUT statement to create a SAS data */
/* set from the ANOVA Output Object. */
ods output ANOVA=anova_out;
/* Create the HTML report and the output data set */
ods select ANOVA;
proc reg data=test;
model y1=x1;
model y=x2;
run;
/* Print the newly generated Analysis of Variance */
/* output data set. */
title1 'Print: Analysis of Variance data set for both models';
proc print data=anova_out;
run;
/* Close the HTML destination */
ods html close;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This example demonstrates how to create an output data set using ODS with the REG procedure.
Type: | Sample |
Topic: | Third Party ==> Output ==> HTML SAS Reference ==> ODS (Output Delivery System)
|
Date Modified: | 2005-09-17 03:02:56 |
Date Created: | 2005-05-23 13:50:38 |
Operating System and Release Information
SAS System | Base SAS | All | 9.1 TS1M3 | n/a |