Page 1 of 1

PRJPoisson—predicted values for a Poisson count data model

Posted: Thu Jul 10, 2008 2:02 pm
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