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]
Re: st: I can't get estout to post e(at) results after margins
From 
 
Austin Nichols <[email protected]> 
To 
 
[email protected] 
Subject 
 
Re: st: I can't get estout to post e(at) results after margins 
Date 
 
Mon, 17 May 2010 16:10:03 -0400 
Carlos Zambrana <[email protected]> :
You can always manipulate the -ereturn- output and repost inside an
eclass program (see also
http://repec.org/bocode/e/estout/advanced.html#advanced907 and
following topics); try e.g. these two methods:
clear all
prog relabat, eclass
 version 11
 if replay() {
 error 198
 }
 tempname a b v
 loc N=e(N)
 mat `b'=e(b)
 mat `v'=e(V)
 mat `a'=e(at)
 forv i=1/`=rowsof(`a')' {
  loc n `n' `=`a'[`i',1]'
  }
 mat colnames `b'=`n'
 mat rownames `v'=`n'
 mat colnames `v'=`n'
 eret post `b' `v', obs(`N')
 eret local cmd="relabat"
 end
sysuse auto
qui regress mpg c.weight##c.weight
margins, dydx("weight") at(weight=(1760(200)4840)) post chainrule
est sto r0
forv i=1/`=rowsof(a)' {
 loc l `l' `=a[`i',1]'
 }
esttab r0, labcol2(`l')
relabat r1
est sto r1
esttab r1
On Mon, May 17, 2010 at 3:06 PM, Carlos Zambrana <[email protected]> wrote:
> Hi all,
>
> Suppose I'm trying to do something like:
>
> clear
> webuse auto
> regress mpg weight c.weight#c.weight
> margins, dydx("weight") at("weight"=(1760(200)4840)) post chainrule
>
> And after that I would like to export a table with the e(at) points
> together with the e(b) coefficients and their respective significance
> stars. I tried
>
> estout, cells("b&_star at")
>
> and
>
> estadd matrix At=e(at)'
> estout, cells("b&_star at At")
>
>  (I also tried "estadd matrix At=e(at)" just in case matrix dimensions mattered)
>
> But i always get a table with the e(b) coefficients and empty spaces
> for the e(at) or e(At) points. I can turn e(b) into a matrix and
> estout the joined (AT\e(b)) matrix but then I can't add the
> significance stars to this matrix.
>
> How can I get e(at) to be treated as an estimates matrix so that I can
> just use estout to post the results to an excel file?
>
> Thanks in advance.
*
*   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/