Bookmark and Share

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   Tim Wade <[email protected]>
To   [email protected]
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 <[email protected]> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index