Published on :
Statistical CREATION_INTERNE

Example 3 PROC HPFMM Documentation: Mixed Poisson Regression

This code is also available in: Deutsch Español Français
Awaiting validation
This script analyzes data from an Ames salmonella assay to illustrate modeling partially variable means. It compares a standard Poisson model with a two-component (k=2) Poisson mixture model. The script demonstrates how to constrain parameters between components (via the 'equate' option or the 'RESTRICT' statement) and examines the effect of an outlier on model fit and overdispersion.
Data Analysis

Type : CREATION_INTERNE


The 'assay' data containing quinoline doses and observed colony counts are created directly within the script via a DATA step and datalines.

1 Code Block
DATA STEP Data
Explanation :
Creation of the 'assay' table. The 'dose' variable is read, a logarithmic transformation 'logd' is calculated, and three 'num' observations are read for each dose (do i=1 to 3 loop).
Copied!
1DATA assay;
2 label dose = 'Dose of quinoline (microg/plate)'
3 num = 'Observed number of colonies';
4 INPUT dose @;
5 logd = log(dose+10);
6 DO i=1 to 3; INPUT num @; OUTPUT; END;
7 DATALINES;
8 0 15 21 29
9 10 16 18 21
10 33 16 26 33
11 100 27 41 60
12 333 33 38 41
131000 20 27 42
14;
2 Code Block
PROC HPFMM
Explanation :
Fitting a standard Poisson regression model (dist=Poisson) to the entire dataset.
Copied!
1 
2PROC HPFMM
3DATA=assay;
4model num = dose logd / dist=Poisson;
5RUN;
6 
3 Code Block
PROC HPFMM
Explanation :
Fitting a 2-component (k=2) Poisson mixture model. The 'equate=effects(dose logd)' option forces the regression coefficients for 'dose' and 'logd' to be identical between the two components.
Copied!
1PROC HPFMM DATA=assay;
2 model num = dose logd / dist=Poisson k=2
3 equate=effects(dose logd);
4RUN;
4 Code Block
PROC HPFMM
Explanation :
Alternative to the previous step using the 'RESTRICT' statement to manually impose equality of 'dose' and 'logd' coefficients between the first (1) and second (-1) components.
Copied!
1PROC HPFMM DATA=assay;
2 model num = dose logd / dist=Poisson k=2;
3 restrict 'common dose' dose 1, dose -1;
4 restrict 'common logd' logd 1, logd -1;
5RUN;
5 Code Block
PROC HPFMM
Explanation :
Refitting the mixture model (k=2, equalized effects) by excluding the outlier observation where num=60 (filter via dataset option where).
Copied!
1PROC HPFMM DATA=assay(where=(num ne 60));
2 model num = dose logd / dist=Poisson k=2
3 equate=effects(dose logd);
4RUN;
6 Code Block
PROC HPFMM
Explanation :
Refitting the simple Poisson model by excluding the outlier observation (num=60).
Copied!
1 
2PROC HPFMM
3DATA=assay(where=(num ne 60));
4model num = dose logd / dist=Poisson;
5RUN;
6 
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 : SAS SAMPLE LIBRARY - NAME: hpfmmex3 - PRODUCT: STAT - REF: Wang, P., Puterman, M. L., Cockburn, I., and Le, N. (1996)