PRJPoisson—predicted values for a Poisson count data model

Use this forum to post complete RATS "procedures". Please be sure to include instructions on using the procedure and detailed references where applicable.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

PRJPoisson—predicted values for a Poisson count data model

Unread post by TomDoan »

This computes the predicted values and marginal effects for a count data model estimated using DDV with TYPE=COUNT.

Code: Select all

*
* @PRJPoisson( options )
* computes prediction and marginal effects for a count data model using the
* Poisson.  This should be only be used after doing DDV with TYPE=COUNT.
*
* Options:
*  XVECTOR=vector of test values for the explanatory variables. Make sure you include
*    1 for the CONSTANT.
*  TITLE=title for output
*
* Revision Schedule:
*  07/2008 Written by Tom Doan, Estima.
*
procedure prjpoisson
option vector        xvector
option string        title
*
local real    p
local vect    ez
local integer j row
*
if .not.%defined(xvector) {
   disp "Syntax: @PRJPOISSON(XVECTOR=xvector,other options)"
   return
}
compute ez=exp(%dot(xvector,%beta))
report(action=define)
compute row=0
if %defined(title)
   report(atrow=(row=row+1),atcol=1,span) title
report(atrow=(row=row+1),atcol=1) "Predicted Value" ez
do j=1,%nreg
   if %eqnreglabels(0)(j)=="Constant"
      next
   report(atrow=(row=row+1),atcol=1) "Marginal "+%eqnreglabels(0)(j) ez*%beta(j)
end do j
report(action=show)
end
Post Reply