BookmarkSubscribeRSS Feed
Psueri
Calcite | Level 5

Hello Sas Community,

I am currently working on a project where I need to utilize PROC COUNTREG in SAS, particularly focusing on utilizing ZICMP distribution with spatialeffects.  


I'm trying to manually score based on the parameters, and from the documentation, I've reconstructed the following steps.

Let:

  • n be the number of observations
  • m be the number of model regressors
  • s be the number of spatial effects regressors
  • z be the number of zero model regressors
  • d be the number of dispersion model regressors
  • X1 (n x m) be the matrix containing the values of m model regressors
  • X2 (n x s) be the matrix containing the values of s spatial effects regressors
  • Z1 (n x z) be the matrix containing the values of z zero model regressors
  • D1 (n x d) be the matrix containing the values of d dispersion model regressors
  • Wmat (n x n) be the spatial weights matrix
  • Beta1 (m x 1) be the vector containing the coefficients of m model regressors
  • Beta2 (s x 1) be the vector containing the coefficients of s spatial effects regressors
  • Gamma (z x 1) be the vector containing the coefficients of z zero model regressors
  • Delta (d x 1) be the vector containing the coefficients of d dispersion model regressors
  • Intercept be the value of the intercept of the model
  • Inf_Intercept be the value of the intercept of the zero model
  • Disp_Intercept be the value of the intercept of the dispersion model

 

Psueri_2-1714146494522.png

 

Psueri_3-1714146494522.png , or Psueri_4-1714146494523.png

 

Psueri_5-1714146494523.png

 

Psueri_6-1714146494523.png

 

Psueri_7-1714146494524.png

But the values of lambda vector obtained in the output of the countreg differs from the ones computed as exp(xbeta), that is instead the value mu in the countreg output.

 

Psueri_8-1714146494524.png

(in documentation there is a typo in the ZICMP, but it's correct in CMP and the results are the same of countreg output)

 

Psueri_9-1714146494524.png

 

Now there isn't a finite form for this Normalization Factor, following the paper:

Approximating the Conway–Maxwell–Poisson distribution normalization constant

Steven B. Gillispie and Christopher G. Green

University of Washington, Seattle, USA — Department of Statistics

Technical Report no. 615

June 6, 2013

 

I found this approximation formula Psueri_10-1714147059902.png

 

And then 

 

Psueri_11-1714147103297.png

Psueri_14-1714147225679.png

 

Psueri_15-1714147225680.png

 

Now, the predicted results obtained do not match those obtained from the output of the countreg. The differing values are: Lambda (as mentioned above), P(y=0), P(y!=0) and Predicted (those three latter are probably due to the Lambda error) 

 

Any examples, tips, or resources you could share would be greatly appreciated. Thank you in advance for your assistance!

 

Best regards,

Piero

1 REPLY 1
Psueri
Calcite | Level 5
I found that the value of Lambda is Lambda = mu^nu
But the values of P(y=0), P(y!=0) and Predicted are still wrong

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 1 reply
  • 242 views
  • 0 likes
  • 1 in conversation