That is exactly what I'm looking for, however applying your code to my
program doesnt work ( though your code works beautifully). I end up
with r503 conformability error. And also instead of a [8,4] matrix I
get a [1,24] matrix.
Moleps
capture program drop bif_des
program bif_des
capture drop _*
quietly des,varlist
local r `r(varlist)'
di "`r'"
tokenize `r'
local first `1'
macro shift
local rest `*'
local t:word count `rest'
tokenize `rest'
forval o=2(2)`t' {
local rowname `rowname' ``o''
gen _``o''pos=1 if (``o''>0 & ``o''<.)
replace _``o''pos=0 if (``o''<0)
estpost tab _``o''pos,mi
matrix def o=e(pct)
matrix def l=e(cumpct)
mat A=(nullmat(A),(o[1,1..2],l[1,2])')
mat list A
}
mat rownames A = `rowname'
end
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/