Published on :
Statistics CREATION_INTERNE

Numerical Descriptive Analysis of Variances

This code is also available in: Deutsch Español Français
Awaiting validation
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.
Copied!
1DATA example;
2 INPUT allsame 2. half6181 2. even6181 2. half5191 2. even5191 2.;
3 DATALINES;
471 61 61 51 51
571 61 62 51 52
671 61 63 51 53
771 61 64 51 54
871 61 65 51 55
971 61 66 51 56
1071 61 67 51 57
1171 61 68 51 58
1271 61 69 51 59
1371 61 70 51 60
1471 61 71 51 61
1571 81 72 51 62
1671 81 73 51 63
1771 81 74 51 64
1871 81 75 51 65
1971 81 76 51 66
2071 81 77 51 67
2171 81 78 51 68
2271 81 79 51 69
2371 81 80 51 70
2471 81 81 91 71
25. . . 91 72
26. . . 91 73
27. . . 91 74
28. . . 91 75
29. . . 91 76
30. . . 91 77
31. . . 91 78
32. . . 91 79
33. . . 91 80
34. . . 91 81
35. . . 91 82
36. . . 91 83
37. . . 91 84
38. . . 91 85
39. . . 91 86
40. . . 91 87
41. . . 91 88
42. . . 91 89
43. . . 91 90
44. . . 91 91
45;
46RUN;
2 Code Block
PROC MEANS
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!
1 
2PROC MEANS
3DATA=example n mean var std min max maxdec=2;
4RUN;
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.