BookmarkSubscribeRSS Feed
Uvanpriya
Calcite | Level 5

Hi, these days I am working with SAS 9.4 in order to do run some simulations related to zero inflated poisson models. But in order to perform a particular calculation I need to extract the parameter estimates given by the model for each simulation and use them within the SAS code itself . Since I am planning to run 10000 simulations it would be a tedious task if I am to manually extract these parameter estimates. Here I have used the genmod procedure to fit the zero inflated poisson model. So does anyone know how to get this done easily in SAS 9.4?

For an example suppose that there are 3 explanatory variables named as x1,x2 and x3. And let e1,e2,e3 be the parameter estimates corresponding to x1,x2,x3 respectively given by the zero inflated poisson model. So then if I need to calculate a value such as

B=e1*x1 + e2*x2 + e3*x3

how can I extract these ei's into the code?

7 REPLIES 7
Rick_SAS
SAS Super FREQ

Please post the code you are currently using.

 

Hopefully, you are using a single data set to contain all 10,000 samples and are using BY-group processing to run the 10,000 analyses, as explained in "Simulation in SAS: The slow way or the BY way."

Hopefully, you are also suppressing all ODS tables and graphs, as discussed in "Turn off ODS when running simulations in SAS."

 

If so, then just use
ODS OUTPUT ParameterEstimates=PE;
to capture the 10,000 parameter estimates in a data set. You can then analyze the sampling distribution of the parameter estimates.

 

To see this process carried out for linear regression, see "Simulate many samples from a linear regression model." The example uses PROC REG and the OUTEST=PE option to create the parameter estimates, but the main ideas apply to PROC GENMOD and Poisson regression as well.

 

 

Uvanpriya
Calcite | Level 5

Thanks for your answer. Got it sorted out.

 

Uvanpriya
Calcite | Level 5

I do understand how SAS calculates the type I sum of squares when the regression model contains only one function. However when it comes to ZIP model the model has 2 functions; log link function to model the counts that follow the poisson distribution and logit link function to model the probability of structural zeros.

( suppose that log link function has 5 explanatory variables and logit link function has 3 explanatory variables)

So here when i ask SAS to calculate the type I sum of squares it gives me the results for both the sub-models.

So in this case in which order does SAS include variables into the model when calculating type I sum of squares? 

 

 

 

Rick_SAS
SAS Super FREQ

The order is determined by the order of the effects in the MODEL and ZEROMODEL statements. If you post your code, we can tell you the exact order.

Uvanpriya
Calcite | Level 5

proc genmod data=stat;

class a;

model y=x1 x2 x3 x4 a / dist=zip link=log Type1;

zeromodel z1 z2 a /link=logit;

run;

This is the code snippet related to that part. Could you please tell me the order in which it calculates the type I error SS?

Uvanpriya
Calcite | Level 5

proc genmod data=stat;

class a;

model y=x1 x2 x3 x4 a / dist=zip link=log Type1;

zeromodel z1 z2 a /link=logit;

run; 

suppose that I need to calculate the type I sum of squares related to categorical variable 'a' in zeromodel function. Then does it make adjustments for variables in both the models when calculating the type I sum of squares for the variable 'a'?

Uvanpriya
Calcite | Level 5
proc genmod data=stat;

class a;

model y=x1 x2 x3 x4 a / dist=zip link=log Type1;

zeromodel z1 z2 a /link=logit;

run;

This is the code snippet related to that part. Could you please tell me the order in which it calculates the type I Sum of Squares?

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
  • 7 replies
  • 1300 views
  • 1 like
  • 2 in conversation