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: How to combine ttest and regression estimates in one table


From   Sergiy Radyakin <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: How to combine ttest and regression estimates in one table
Date   Tue, 4 Feb 2014 18:16:17 -0500

Evert, Stata can write any results to Excel, but the layout it up to
you. Use the xl  class in Mata and with a couple of loops you should
be ok. Sergiy.
PS: either gmail or your mailer, or Stata itself is wrapping the lines
so heavily, it is not possible to recognize a table in your posting.
With long texts, it is safer to write:

c11 c12 c13
c21 c22 c23
c31 c32 c33
---------------------------------------------
c11="State"
c12="Regression coefficient"
c13="Impact of unemployment rate"
c21="Alabama"
...
---------------------------------------------
// Example code to write something to an XLS file:
sysuse auto
regress price weight length if foreign
regress price weight length if !foreign
// do whatever estimations and save the results from e() or r()
//.....
// output the results to Excel
mata
  b=xl()
  b.create_book("Results","Sheet1")
  b.put_string(1,1,"Variable")
  b.put_string(1,2,"Coefficient")
  b.put_string(1,3,"Test")

  b.put_string(2,1,"weight")
  b.put_string(3,1,"length")

  b.put_number(2,2,0.654)
  b.put_number(2,3,0.124)
  b.put_number(3,2,0.434)
  b.put_number(3,3,0.294)
end

On Tue, Feb 4, 2014 at 4:52 PM, Evert Reins <[email protected]> wrote:
> Dear Stata List users,
>
> I want to combine ttest and regression estimates in one table.
>
> I am currently working on my bachelor thesis in economics. In this regard,
> I conduct an analysis of the impact effects of "Job Corps" a program
> implemented by the DOL, which helps young people to find access to the
> labor market. Anyways, I am approaching the question, whether there is a
> correlation between the earnings of participants in the program and the
> economic situation in the state, where they live and work in. Therefore, I
> so far generated a data set which yields information about the earnings and
> state of residence, their belonging to the treatment (control)group (binary
> variable 0/1), plus key indicators for the economy of the state (minimum
> wage, unemployment rate, gdp growth rate...).
>
> Now I want to generate a table which shows the ttest values for difference
> in earnings for the treatment variable per participant (1st column) sorted
> by state combined with the regression outcomes for each indicator,
> regarding the earnings. To illustrate, it should look something like this:
>
>
>
> State                   difference in earnings                   impact
> of uenemployment rate               ....
>
> Alabama              difference in dollars                      regression
> coefficient (t-value)                ....
>
> Alaska
> -$152                                                    1.5677 (1.98)
>
> Thanks for your consideration
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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