Bookmark and Share

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

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

Re: st: Test Results in Table

From   daniel klein <[email protected]>
To   [email protected]
Subject   Re: st: Test Results in Table
Date   Fri, 19 Aug 2011 13:19:24 +0200


without seeing at least part of your loop it is hard to give specific
advice, but I guess you should use -matrix- to store your results. To
do so, you will have to set up a matrix before your loop starts. Let's
say you want to have a 3 by 4 matrix to put your results. You  code

. matrix <somename> = J(3, 4, .)

Inside your loop you will need a local (or probably two locals) that
indicate the row and colum you want the respective result to go. This
looks something like

. <somename>[`r', `c'] = <some_r_or_e_result>

,where r and c are the local indicating the row and colum of matirx
<somename> and <some_r_or_e_result> is the result you want to place
there (e.g. a p-value).

When looping is done you can look into -outtable- (Kit Baum, Joao
Pedro Azevedo) or -mat2txt- (Michael Blasnik, Ben Jann), both
available from SSC to export your matrix.


Toby wrote:
I want to save different
values of this statistical tests (p-Values etc.) in a table that is
somehow exportable  into another program (for example txt or xls).[...]
*   For searches and help try:

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