Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Problem transposing esttab results


From   Yogesh Uppal <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Problem transposing esttab results
Date   Fri, 1 Nov 2013 16:08:38 -0400

Hi All,

I am using instructions given here for transposing esttab results (the
regressions results in each row rather than in columns):
http://www.stata.com/statalist/archive/2009-01/msg01084.html

Given my limited programing skills, I am running the following and
keep getting the error 'matrix b not found':

eststo model1: xi: quietly xtivreg2  y x1
state_specific_trend1-state_specific_trend25 i.year, fe cluster(id)
eststo model2: xi: quietly xtivreg2  y x2
state_specific_trend1-state_specific_trend25 i.year, fe cluster(id)
esttab, se nostar
matrix C = r(coefs)
eststo clear
local rnames : rownames C
local models : coleq C
local models : list uniq models
local i 0
foreach name of local rnames {
    local ++i
    local j 0
    capture matrix drop b
    capture matrix drop se
    foreach model of local models {
        local ++j
        matrix tmp = C[`i', 2*`j'-1]
        if tmp[1,1]<. {
            matrix colnames tmp = `model'
            matrix b = nullmat(b), tmp
            matrix tmp[1,1] = C[`i', 2*`j']
            matrix se = nullmat(se), tmp
        }
    }
    ereturn post b
    quietly estadd matrix se
    eststo `name'
}
esttab, se mtitle noobs
eststo clear


I am really not sure what I am missing esp. because I dont fully
understand the code in the first place. Will really appreciate any
help.

Yogesh
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index