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

RE: st: making tables from test statistics

From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: making tables from test statistics
Date   Tue, 4 Sep 2007 18:53:40 +0100

There is more than one way to do it. 

Here is an alternative. 

gen Variable = "" 
gen dfuller = "" 
local i = 0 

foreach v in m1 m2 consump { 
	local ++i 
	replace Variable = "`v'" in `i' 
	dfuller `v' 
	replace dfuller = string(r(Zt), "%6.4g") in `i' 

tabdisp Variable, cell(dfuller) in 1/`i' 

Disadvantages of this: 

1. The results are not aligned with your existing data. Could
lead to misunderstanding. 

2. Will be problematic if #results > _N. 

3. -tabdisp- is limited to 5 cell variables. 

Advantages of this: 

1. Keeps results together with existing data. 

2. Further analysis, graphing, etc., often easy. 

3. Can control formats desired at source. 

4. Can elaborate, e.g. by using variable labels. 

[email protected] 

Austin Nichols
> Partha Deb <[email protected]>:
> I think you can trick -estout- into doing that, by generating
> variables holding the values of your test statistics, and using its
> summary stats capability.  But that would be horribly inefficient
> compared to just writing a tab-delimited text file using the -file-
> command:
> webuse friedman2, clear
> file close _all
> file open t using /test.txt, write replace
> file write t "Variable" _tab "dfuller"
> qui dfuller m1
> file write t _n "m1" _tab "`: di %6.4g r(Zt)'"
> qui dfuller m2
> file write t _n "m2" _tab "`: di %6.4g r(Zt)'"
> qui dfuller consump
> file write t _n "consump" _tab "`: di %6.4g r(Zt)'"
> file close _all
> type /test.txt
> On 9/4/07, Partha Deb <[email protected]> wrote:
> > Hi,
> >
> > Is there a package akin to -estout- or -outreg- to make 
> tables from test
> > statistics?  I'm conducting a series of tests on a number 
> of variables and
> > would like to tabulate the statistics.  E.g., from

*   For searches and help try:

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