BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Salih
Calcite | Level 5

I have been trying to get predicted probability for each count. I am putting code "predicted=" after model statement but that is giving me the mean of poisson. How can I get predicted probability based on poisson for each count and graph it?

 

data world;
input scores @@;
datalines;
4 3 3 3 2 4 2 0 3 3 3 2 4 2
1 1 1 3 7 3 2 2 2 5

..........
;

proc genmod data=world;
model scores= /dist=poisson link=log;
output out=new predicted=predictedscores;
run;
quit;

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Diy then,

 

data probs;
set new;
prob = pdf("Poisson", scores, predictedScores);
run;
PG

View solution in original post

4 REPLIES 4
PGStats
Opal | Level 21

If you have a SAS/ETS license, proc countreg provides option prob= in the output statement to compute those probabilities.

PG
Salih
Calcite | Level 5

I don't have SAS/ETS. I am using SAS studio university edition. I tried countreg, didn't work.

PGStats
Opal | Level 21

Diy then,

 

data probs;
set new;
prob = pdf("Poisson", scores, predictedScores);
run;
PG
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

I'd say that your code is doing exactly what you've specified: you've specified an intercept-only model, so predictions for all observations will be equal to the intercept.

 

I don't have an idea about what you would rather be doing, but I'm guessing it might be more along the lines of your other question

https://communities.sas.com/t5/SAS-Statistical-Procedures/proc-genmod-graphics-for-count-data-model-..., where you've gotten two good solutions.

 

 

 

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
  • 4 replies
  • 1447 views
  • 0 likes
  • 3 in conversation