Hello,
I am running a two-component mixture model via PROC FMM, and want to compare the coefficient of a variable from the first component to the coefficient of the same variable in the second component. I noticed PROC FMM does not have an ESTIMATE or CONTRAST statement available, and I am wondering if it is otherwise possible to implement this comparison. Using the example below, I would like to compare the coefficient for 'dose' in component 1 to the coefficient for 'dose' in component 2 (and ideally get a confidence interval as well). I appreciate any suggestions.
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 ; run; proc fmm data=assay; model num = dose logd / dist=Poisson k = 2; run;
You can use the NLEST macro after saving the parameter estimates table and the covariance matrix table (which must be requested with the COV option). As described in the macro documentation, when using the inest= and incovb= options, as is required here since FMM does not support the STORE statement, it is important to make the parameter estimates and covariance matrix data sets compatible. You can see by examining them that this requires dropping the last row and column of the covariance matrix data set. And the extraneous numeric variables in that data set must also be dropped, which can be done with the covdrop= option. So, the following makes the comparison you want.
proc fmm data=assay cov;
model num = dose logd / dist=Poisson k = 2;
ods output parameterestimates=pe cov=cov(where=(modelno=1));
run;
%nlest(inest=pe,incovb=cov,covdrop=modelno component col7,f=b_p2-b_p5)
You can use the NLEST macro after saving the parameter estimates table and the covariance matrix table (which must be requested with the COV option). As described in the macro documentation, when using the inest= and incovb= options, as is required here since FMM does not support the STORE statement, it is important to make the parameter estimates and covariance matrix data sets compatible. You can see by examining them that this requires dropping the last row and column of the covariance matrix data set. And the extraneous numeric variables in that data set must also be dropped, which can be done with the covdrop= option. So, the following makes the comparison you want.
proc fmm data=assay cov;
model num = dose logd / dist=Poisson k = 2;
ods output parameterestimates=pe cov=cov(where=(modelno=1));
run;
%nlest(inest=pe,incovb=cov,covdrop=modelno component col7,f=b_p2-b_p5)
This is exactly what I was looking for. Thank you!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.