The program loads data from SASHELP.BASEBALL into the temporary library. It then performs several successive univariate analyses: normality tests on runs (nRuns), generation of descriptive graphs, and calculation of basic confidence intervals with hypothesis testing (mu0=100) for hits (nHits). Specific percentiles are exported to an output table.
Data Analysis
Type : SASHELP
Data is sourced from the standard SASHELP library, BASEBALL table, copied locally to the WORK.BASEBALL table.
1 Code Block
DATA STEP Data
Explanation : Copies the source table SASHELP.BASEBALL to the temporary table WORK.BASEBALL for local manipulation.
Copied!
data baseball;
SET sashelp.baseball;
run;
1
DATA baseball;
2
SET sashelp.baseball;
3
RUN;
2 Code Block
PROC PRINT
Explanation : Displays the content of the baseball table in the standard output.
Copied!
proc print data=baseball;
run;
1
PROC PRINTDATA=baseball;
2
RUN;
3 Code Block
PROC UNIVARIATE
Explanation : Executes the UNIVARIATE procedure with the NORMAL option to perform normality tests on the 'nRuns' variable.
Copied!
proc univariate data=baseball normal;
var nRuns;
run;
1
2
PROC UNIVARIATE
3
DATA=baseball normal;
4
var nRuns;
5
RUN;
6
4 Code Block
PROC UNIVARIATE
Explanation : Generates statistical graphs (histograms, box plots, QQ-plots) for the 'nRuns' variable.
Copied!
proc univariate data=baseball plot;
var nRuns;
run;
1
2
PROC UNIVARIATE
3
DATA=baseball plot;
4
var nRuns;
5
RUN;
6
5 Code Block
PROC UNIVARIATE
Explanation : Combines PLOTS and NORMAL options to simultaneously obtain graphs and normality tests on 'nRuns'.
Copied!
proc univariate data=baseball plots normal;
var nRuns;
run;
1
2
PROC UNIVARIATE
3
DATA=baseball plots normal;
4
var nRuns;
5
RUN;
6
6 Code Block
PROC UNIVARIATE Data
Explanation : Analyzes the 'nHits' variable with basic confidence intervals (CIBASIC) and tests the hypothesis mean=100 (MU0=100). Creates an output table 'stats' containing the 33.3 and 66.7 percentiles.
Explanation : Second display of the content of the baseball table.
Copied!
proc print data=baseball;
run;
1
PROC PRINTDATA=baseball;
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.