The script begins by creating a dataset named 'example' using a DATA step with embedded data via the DATALINES statement. This dataset contains five numerical variables ('allsame', 'half6181', 'even6181', 'half5191', 'even5191'). Then, the PROC MEANS procedure is used to calculate key descriptive statistics such as the number of observations, mean, variance, standard deviation, minimum, and maximum for all numerical variables in the 'example' dataset.
Data Analysis
Type : CREATION_INTERNE
The 'example' dataset is created directly within the script using a DATA step and data embedded via the `datalines` statement. There is no dependency on external data sources or SASHELP.
1 Code Block
DATA STEP Data
Explanation : This DATA block creates the 'example' dataset. The variables `allsame`, `half6181`, `even6181`, `half5191`, and `even5191` are defined as numeric with a length of 2. Data is read directly from the provided lines (`datalines`), allowing for entirely self-contained data creation within the script.
Explanation : This block uses the PROC MEANS procedure to calculate descriptive statistics for all numeric variables in the 'example' dataset. Requested statistics include the number of observations (N), mean (MEAN), variance (VAR), standard deviation (STD), minimum (MIN), and maximum (MAX). The `maxdec=2` option formats the output with two decimal places for the calculated statistics.
Copied!
proc means data=example n mean var std min max maxdec=2;
run;
1
2
PROC MEANS
3
DATA=example n mean var std min max maxdec=2;
4
RUN;
5
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.