Nick Cox
> 
> =========== begin ppa.ado
> program def ppa, rclass 
>         version 7 
>         syntax varlist(numeric min=2 max=2) [if] [in] 
>         marksample touse 
>         tokenize `varlist' 
>         args o1 o2 
>         qui count if ((`o1' > 0) | (`o2' > 0)) & `touse' 
>         local denom = r(N) 
>         qui count if (`o1' > 0) & (`o2' > 0) & `touse' 
>         local ppa = r(N) / `denom' 
>         di 
>         di as text "Chamberlain's PPA measure  " _c 
>         di as res %5.4f `ppa' "  (" %5.2f 100 * `ppa' " %)"
> end 
> ============== end ppa.ado 
> 
> Syntax: ppa obs1 obs2 [if] [in] 
 
This lacks a line at the end 
before the -end- statement
return local ppa = `ppa' 
Nick 
[email protected] 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/