The script begins by setting a global title for the output. It then initializes a dataset named 'Scores' by directly providing gender and score data via the `datalines` statement. The TTEST procedure is executed twice to compare the mean of 'Score' between 'Gender' categories. ODS statements are present but commented out, indicating an intention for output management (HTML, PDF) that is not active in this version of the code.
Data Analysis
Type : INTERNAL_CREATION
The data for the 'Scores' dataset is created directly within the SAS script via a DATA step and the `datalines` statement. It includes 'Gender' (f/m) and 'Score' variables.
1 Code Block
DATA STEP Data
Explanation : Creates a new SAS dataset named 'Scores' containing two variables: 'Gender' (character, indicated by '$') and 'Score' (numeric). Observations are provided inline via the `datalines` statement.
Copied!
data Scores;
input Gender $ Score;
datalines;
f 75 f 76 f 80 f 77 f 80 f 77 f 73
m 82 m 80 m 85 m 85 m 78 m 87 m 82
;
1
DATA Scores;
2
INPUT Gender $ Score;
3
DATALINES;
4
f 75 f 76 f 80 f 77 f 80 f 77 f 73
5
m 82 m 80 m 85 m 85 m 78 m 87 m 82
6
;
2 Code Block
PROC TTEST
Explanation : Executes a TTEST procedure to perform an independent samples t-test. It compares the mean of the 'Score' variable between different levels of the 'Gender' classification variable. The commented ODS instructions around this block indicate an intention to customize the output.
Copied!
proc ttest;
class Gender;
var Score;
run;
1
PROC TTEST;
2
class Gender;
3
var Score;
4
RUN;
3 Code Block
PROC TTEST
Explanation : Second execution of the TTEST procedure with the same parameters as the previous one. This allows for repeating the analysis or demonstrating different ODS options if the comments were active. The commented ODS instructions around this block are not active.
Copied!
proc ttest;
class Gender;
var Score;
run;
1
PROC TTEST;
2
class Gender;
3
var Score;
4
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.
Copyright Info : S A S S A M P L E L I B R A R Y
NAME: ODSEX1
TITLE: Documentation Example 1 for ODS
PRODUCT: STAT
SYSTEM: ALL
KEYS: ODS
PROCS: TTEST
DATA:
REF: Using the Output Delivery System
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.