Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[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   Fri, 30 Mar 2012 11:36:49 -0400

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?


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

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

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 Baum   |   Boston College Economics and DIW Berlin   |
An Introduction to Stata Programming   |
An Introduction to Modern Econometrics Using Stata   |

*   For searches and help try:

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