Published on :
Statistical CREATION_INTERNE

Example 3 PROC FMM: Mixed Poisson Regression

This code is also available in: Deutsch Español Français
Awaiting validation
This script analyzes biological assay data (Ames salmonella assay). It begins by creating an internal dataset, then fits several models: a simple Poisson regression, a two-component Poisson mixture model with constrained effects (via EQUATE and RESTRICT), and finally examines the impact of an outlier by refitting the models on a subset of data.
Data Analysis

Type : CREATION_INTERNE


The 'assay' data is created directly in the script using a DATA step and the DATALINES statement.

1 Code Block
DATA STEP Data
Explanation :
Creation of the 'assay' dataset containing quinoline doses and observed colony counts. The 'logd' variable (log of dose) is calculated.
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 FMM
Explanation :
Fitting a standard Poisson regression model (k=1 by default) to model colony count as a function of dose.
Copied!
1 
2PROC FMM
3DATA=assay;
4model num = dose logd / dist=Poisson;
5RUN;
6 
3 Code Block
PROC FMM
Explanation :
Fitting a two-component Poisson mixture model (k=2). The 'equate=effects(dose logd)' option forces the regression coefficients for 'dose' and 'logd' to be identical across both mixture components.
Copied!
1PROC FMM DATA=assay;
2 model num = dose logd / dist=Poisson k=2
3 equate=effects(dose logd);
4RUN;
4 Code Block
PROC FMM
Explanation :
An alternative to the EQUATE option using the RESTRICT statement to force parameter equality between the two components (dose 1 = dose 2 and logd 1 = logd 2).
Copied!
1PROC FMM 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 FMM
Explanation :
Refitting the two-component Poisson mixture model (k=2) excluding an outlier observation (num=60) to see its impact on the fit.
Copied!
1PROC FMM 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 FMM
Explanation :
Refitting the simple Poisson model excluding the outlier observation.
Copied!
1 
2PROC FMM
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