Published on :
Statistical CREATION_INTERNE

Alcohol-Malformation Relationship Analysis

This code is also available in: Deutsch Español Français
Awaiting validation
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.
Copied!
1DATA infants;
2 INPUT malform alcohol count @code_sas_json/8_SAS_Intro_ReadFile_MultiCol_@@.json;
3 CARDS;
4 1 0 17066 1 0.5 14464 1 1.5 788 1 4.0 126 1 7.0 37
5 2 0 48 2 0.5 38 2 1.5 5 2 4.0 1 2 7.0 1
6 ;
2 Code Block
PROC FREQ
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).
Copied!
1PROC FREQ;
2 WEIGHT count;
3 TABLES alcohol*malform/chisq cmh1 trend;
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.