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: 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
Toby,
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.
Best
Daniel
---
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:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/