[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Table of results

From   Ronnie Babigumira <>
Subject   Re: st: Table of results
Date   Wed, 24 Oct 2007 18:34:43 +0200

Dear Austin
Thanks for the reply. This completely new but exciting territory for me.

I have tried to follow the example in the link you sent and here is what I have done so far (I welcome any comments you may have to make it better).

local r1c1= `"Radius"'
local r1c2= r(attr)
local r1c3= r(seattr)
local r1c4= r(tsattr)

tempname out
file open `out' using rx_results.txt, write replace
file write `out' "Method" _tab "Effect" _tab "SE" _tab "t"
file write `out' _n "`: di "`r1c1'"'"
file write `out' _tab "`: di %4.3f `r1c2''"
file write `out' _tab "`: di %4.3f `r1c3''"
file write `out' _tab "`: di %4.3f `r1c4''"
file close `out'

I had some trouble including the method name but after trying a whole set of quote combinations, I got lucky. Here is what the first take of rx_results.txt looks like

Method Effect SE t
Radius -0.182 0.010 -18.119

Just a couple of questions.

i) If I have 10 rows and 4 columns so what the locals are r1/r10 and c1/c4. How would I put this in a loop
ii) My plan is to typeset this in LaTeX so is it a simple matter of replacing the _tab with "&" and adding an extra line with \\ to close the row.

Many many thanks (you have no idea how much time I have spent on this)


Austin Nichols wrote:

You can collect these items in locals (calling them e.g. r1c1 r1c2
etc. for the eventual row and column they should appear in), then
write a table to the Results window or a file, or you can write a
table to a text file as you go using the -file- command; see e.g.

On 10/24/07, Ronnie Babigumira <> wrote:
Dear Listers
I am estimating treatment effects using the -pscore-/-att*- suite of programs (Becker and Ichino, Stata Journal 2,4).

Each of the att* commands leaves behind among other results
- the treatment effect
- Standard error
- t value

though, the macro names are different so for example, for -attnd- they would be
effect: r(attnd)
se:     r(seattnd)
t:      r(tsattnd)

While -attr- we would have
effect: r(attr)
se:     r(seattr)
t:      r(tsattr)

I will be trying a number of options and would like to have all the results in one table that would look something like
this one below

  |    method | effect | s_e | t |
  | nearneigh |   1000 |  10 | 3 |
  |           |      . |   . | . |
  |           |      . |   . | . |

How can I do this in Stata

*   For searches and help try:

*   For searches and help try:

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