The script starts with a DATA step to create a dataset named 'Stats'. Inside this DATA step, a 'DO' loop iterates over 'x' values ranging from -2 to 2 by steps of 1. For each 'x' value, it calculates the standard normal cumulative distribution function (CDF('NORM', x)) and a parameterized version of the normal cumulative distribution function (CDF('NORM', x, 1, 1), with mean 1 and standard deviation 1). Then, it applies the PROBIT function to the first calculated CDF value to obtain the inverse quantile value. Each row of results is added to the 'Stats' dataset. Finally, a PROC PRINT is used to display the content of the 'Stats' dataset with a specific title.
Data Analysis
Type : CREATION_INTERNE
The data is entirely generated within the SAS script via a DATA step using a DO loop and built-in statistical functions (CDF, PROBIT).
1 Code Block
DATA STEP Data
Explanation : This DATA step block creates the 'Stats' dataset. It initializes an 'x' variable and iterates from -2 to 2. For each 'x', it calculates two values of the normal cumulative distribution function (F1 and F2) and the inverse quantile function (PROBIT) for F1. The OUTPUT command adds the row to the 'Stats' dataset at each iteration.
Copied!
DATA Stats;
DO x = -2 TO 2 BY 1;
F1 = CDF('NORM', x);
F2 = CDF('NORM', x, 1, 1);
P = PROBIT(F1);
OUTPUT;
END;
RUN;
1
DATA Stats;
2
DO x = -2 TO 2BY1;
3
F1 = CDF('NORM', x);
4
F2 = CDF('NORM', x, 1, 1);
5
P = PROBIT(F1);
6
OUTPUT;
7
END;
8
RUN;
2 Code Block
PROC PRINT
Explanation : This block defines a title for the output and uses PROC PRINT to format and display the content of the previously created 'Stats' dataset, including columns x, F1, F2, and P.
Copied!
TITLE "STATS";
PROC PRINT DATA=Stats; RUN;
1
TITLE "STATS";
2
PROC PRINTDATA=Stats; 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.