Published on :
Statistics INTERNAL_CREATION

Introduction Example 3 for PROC GENMOD (GEE)

This code is also available in: Deutsch Español Français
Awaiting validation
This script creates a 'six' dataset containing information about respiratory symptoms (wheeze) in two cities (Kingston and Portage). It then uses the GENMOD procedure to fit a logistic regression model (binomial distribution) to predict the presence of wheezing based on city, age, and smoking status. The REPEATED statement is used to specify an exchangeable correlation structure (type=exch) to manage repeated measures on the same subject ('case' variable).
Data Analysis

Type : INTERNAL_CREATION


Data is manually generated within the script via the DATA 'six' step and the DATALINES statement. No external source is required.

1 Code Block
DATA STEP Data
Explanation :
Creates the 'six' dataset by reading raw data included in the code. A DO loop is used to read multiple observations (4 repeated measures per subject) from a single line of source data. Note: The original code contains artifacts ' @code_sas_json...' which appear to be copy-paste errors replacing the standard ' @code_sas/16.4'.sas line retention sign.
Copied!
1DATA six;
2 INPUT case city$ @;
3 DO i=1 to 4;
4 INPUT age smoke wheeze @;
5 OUTPUT;
6 END;
7 DATALINES;
8 1 portage 9 0 1 10 0 1 11 0 1 12 0 0
9 ...
10;
2 Code Block
PROC GENMOD
Explanation :
Executes a generalized linear models analysis. The model specifies a binomial distribution for the dependent variable 'wheeze'. The REPEATED statement manages the correlation between observations of the same subject ('case') by using an exchangeable covariance structure, typical of GEE analyses.
Copied!
1PROC GENMOD DATA=six;
2 class case city;
3 model wheeze(event='1') = city age smoke / dist=bin;
4 repeated subject=case / type=exch covb corrw;
5RUN;
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.