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: bX


From   Christopher Baum <[email protected]>
To   "[email protected]" <[email protected]>
Subject   re: st: bX
Date   Sat, 31 Mar 2012 08:07:02 -0400

<>
My original post was missing one line:

<>
Chiara said

margins, by(married occupation)
gives me the product between the Betas of the estimated wage reg and
the mean value of characteristics for each occupation, for married and
unmarried. Right?

Correct. 

She then said

margins, by(fem occupation)
gives me all the values of the interactions between fem#occupation,
therefore a total of 14 interactions (2 genders*7 occupations):
...
is it possible to gen a new variable for each of the listet interaction?
For example, a variable taking the value 2.398703, etc. This is useful
for me, since therafter I have to compute calculations by using these
interactions.


You don't need a set of variables; these are scalar quantities. Any computations you want to do you can do with 
what comes back from margins. After giving the margins command, type

mat list r(table)

and you will find all of those numbers. You can then do something like (in the example I gave, there are 26 conditonal means):

mat res = r(table)                <=====================
forv i=1/26 {
	 sca mu`i' = res[1,`i']
}
di mu1
di mu2
...

Those scalars can be used to do any computations you need. You can also retrieve their standard errors
if those are needed in the computation.

Kit

Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
                             An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
  An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html


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