This script begins by creating a dataset named 'infants' from included raw data (CARDS). It uses the ' @@' (double trailing at) operator in the INPUT statement to read multiple observations per physical line. Subsequently, a PROC FREQ is executed to analyze the 'alcohol*malform' contingency table, weighted by the 'count' variable, generating Chi-square, Cochran-Mantel-Haenszel, and trend test statistics.
Data Analysis
Type : CREATION_INTERNE
Data is defined directly within the script via the CARDS statement. Each data line contains multiple triplets (malform, alcohol, count).
1 Code Block
DATA STEP Data
Explanation : Creation of the SAS 'infants' table. The INPUT statement uses the ' @@' symbol to maintain the read pointer on the current line, allowing multiple records (sets of malform, alcohol, count variables) defined on a single physical line in the CARDS section to be read.
Explanation : Execution of a frequency analysis. The WEIGHT statement indicates that the 'count' variable represents the number of occurrences. The TABLES statement cross-tabulates alcohol and malformation and requests Chi-square (CHISQ), Cochran-Mantel-Haenszel (CMH1) analysis, and trend test statistics (TREND).
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.