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!
data assay;
label dose = 'Dose of quinoline (microg/plate)'
num = 'Observed number of colonies';
input dose @;
logd = log(dose+10);
do i=1 to 3; input num @; output; end;
datalines;
0 15 21 29
10 16 18 21
33 16 26 33
100 27 41 60
333 33 38 41
1000 20 27 42
;
1
DATA 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 152129
9
10161821
10
33162633
11
100274160
12
333333841
13
1000202742
14
;
2 Code Block
PROC HPFMM
Explanation : Fitting a standard Poisson regression model (dist=Poisson) to the entire dataset.
Copied!
proc hpfmm data=assay;
model num = dose logd / dist=Poisson;
run;
1
2
PROC HPFMM
3
DATA=assay;
4
model num = dose logd / dist=Poisson;
5
RUN;
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!
proc hpfmm data=assay;
model num = dose logd / dist=Poisson k=2
equate=effects(dose logd);
run;
1
PROC HPFMMDATA=assay;
2
model num = dose logd / dist=Poisson k=2
3
equate=effects(dose logd);
4
RUN;
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.
Explanation : Refitting the mixture model (k=2, equalized effects) by excluding the outlier observation where num=60 (filter via dataset option where).
Copied!
proc hpfmm data=assay(where=(num ne 60));
model num = dose logd / dist=Poisson k=2
equate=effects(dose logd);
run;
1
PROC HPFMMDATA=assay(where=(num ne 60));
2
model num = dose logd / dist=Poisson k=2
3
equate=effects(dose logd);
4
RUN;
6 Code Block
PROC HPFMM
Explanation : Refitting the simple Poisson model by excluding the outlier observation (num=60).
Copied!
proc hpfmm data=assay(where=(num ne 60));
model num = dose logd / dist=Poisson;
run;
1
2
PROC HPFMM
3
DATA=assay(where=(num ne 60));
4
model num = dose logd / dist=Poisson;
5
RUN;
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)
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.