Programming the statistical procedures from SAS

poisson predicted probability for counts

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

poisson predicted probability for counts

[ Edited ]

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;


Accepted Solutions
Solution
a week ago
Esteemed Advisor
Posts: 5,539

Re: poisson predicted probability for counts

Diy then,

 

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

View solution in original post


All Replies
Esteemed Advisor
Posts: 5,539

Re: poisson predicted probability for counts

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

PG
Occasional Contributor
Posts: 6

Re: poisson predicted probability for counts

[ Edited ]

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

Solution
a week ago
Esteemed Advisor
Posts: 5,539

Re: poisson predicted probability for counts

Diy then,

 

data probs;
set new;
prob = pdf("Poisson", scores, predictedScores);
run;
PG
PROC Star
PROC Star
Posts: 404

Re: poisson predicted probability for counts

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.

 

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 99 views
  • 0 likes
  • 3 in conversation