Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: St: Chamberlain's PPA


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: St: Chamberlain's PPA
Date   Thu, 6 Feb 2003 19:24:09 -0000

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index