Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: Test Results in Table


From   Tim Wade <wadetj@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Test Results in Table
Date   Sat, 20 Aug 2011 18:09:18 -0400

Here is an example using -postfile-

sysuse auto.dta
tempname memhold
tempfile results
postfile `memhold' str10 name pval using `results'
foreach var of varlist  price mpg headroom trunk weight length turn {
ttest `var', by(foreign)
post `memhold' ("`var'") (r(p))
}
postclose `memhold'
use `results', clear
list


     +---------------------+
     |     name       pval |
     |---------------------|
  1. |    price   .6801851 |
  2. |      mpg   .0005254 |
  3. | headroom   .0110486 |
  4. |    trunk     .00166 |
  5. |   weight   2.62e-08 |
     |---------------------|
  6. |   length   1.14e-07 |
  7. |     turn   1.66e-09 |
     +---------------------+



On Fri, Aug 19, 2011 at 6:48 AM, Toby <spiegeldesaster@googlemail.com> wrote:
> Dear List-Readers,
>
> I have a problem, that I am pretty sure of that most of you have a
> handy solution for.
>
> I want to program a Do-File which performs multiple statistical test
> with different subsets of my dataset. Since there is a multitude of
> subsets I programmed  a for-loop to perform these test pretty quick.
>
> So far, so good. No comes the "though" part. 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).
> What I can do and have done is save these values in new generated
> variables, but this is definitefly not helping to export, or do I have
> a fundamentally wrong approach here? I tried a bit with tabout and
> estout, but figured out that they are only helpful for estimation
> methods and  summary statistics.
>
> I heard of the matrix program, but I am not quite sure how to apply it
> to my problem.
>
> What do you recommend?
>
> Kind Regards,
> Toby
> *
> *   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/
>

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index