Hi,
I am fitting a finite mixture model using the following code:
proc fmm data=mydataset;
class x1 ;
model y = x1 x2 / dist=poisson k=4;
restrict x2 1, x2 -1,x2 1,x2 -1;
run;
I would like to restrict x2 to be the same across the 4 classes. I have seen examples for k=2 and in fact the code above makes the x2 coeffs equal in the first 2 components but the coefs in the 3rd and 4rth components are not the same.
I have tried different combinations but they have failed.
It would be great if you could help me correctly add the restrict statement.
Thank you,
Nikos
SAS 9.4
I have found a solution by applying 3 restrict statements:
restrict X2 1 , X2 -1;
restrict X2 1, X2 0, X2 -1;
restrict X2 0, X2 0, X2 1, X2 -1;
Thank you,
Nikos
It looks like your problem is equivalent to modeling (y - x2). I suggest you create a new variable
Y2 = Y - X2;
and then
MODEL Y2 = X1 / dist=Poisson k=4;
Dear Rick,
Thank you for the response which I tried to implement.
The model converged but provided no estimates for the predictor and only values for the intercepts of the 4 components.
The Pearson statistic is also strange 4.12E-15! I have about 400 observations.
For the above model I subtracted the continuous predictor X2 from the Y and X1 was binary.
Also, what if all my predictors are all categorical?
Best,
Nikos
OK, thanks for the report. I haven't used the RESTRICT statement in FMM, so I thought I'd suggest a workaround. Hopefully, someone with more experience will provide an answer.
I have found a solution by applying 3 restrict statements:
restrict X2 1 , X2 -1;
restrict X2 1, X2 0, X2 -1;
restrict X2 0, X2 0, X2 1, X2 -1;
Thank you,
Nikos
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.