The data used for regression comes from the `class` dataset of the standard `sashelp` library. Metadata exploration is also performed on the `sashelp` library itself.
1 Code Block
PROC REG
Explanation : This block executes the linear regression procedure (`PROC REG`). It specifies that the data comes from the `class` dataset of the `sashelp` library. The `model weight = height;` statement defines a model where `weight` is the dependent variable and `height` is the independent variable. `QUIT;` terminates the procedure.
Copied!
proc reg data=sashelp.class;
model weight = height;
quit;
1
2
PROC REG
3
DATA=sashelp.class;
4
model weight = height;
5
QUIT;
6
2 Code Block
PROC CONTENTS Data
Explanation : This block is designed to extract metadata from SAS objects. `ODS SELECT NONE;` temporarily suppresses all ODS output to the screen. `PROC CONTENTS DATA=SASHELP._ALL_;` analyzes all objects (`_ALL_`) in the `sashelp` library. `ODS OUTPUT MEMBERS=M;` redirects the `members` output table (containing metadata) to a new dataset named `m` in the temporary work library. `ODS SELECT ALL;` re-enables all ODS output.
Explanation : This block uses `PROC PRINT` to display the content of the last created dataset, which is `m`. The `WHERE MEMTYPE = 'DATA';` clause filters observations to show only those where the member type is 'DATA', i.e., SAS tables.
Copied!
proc print;
where memtype = 'DATA';
run;
1
PROC PRINT;
2
where memtype = 'DATA';
3
RUN;
4 Code Block
PROC CONTENTS
Explanation : This last block re-executes `PROC CONTENTS` on `sashelp._all_` to display the complete metadata of the `sashelp` library directly in the default ODS output, as ODS outputs were re-enabled previously.
Copied!
proc contents data=sashelp._all_;
run;
1
PROC CONTENTSDATA=sashelp._all_;
2
RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.