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: twoway line


From   Christopher Baum <kit.baum@bc.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   re: st: twoway line
Date   Sun, 7 Oct 2012 12:24:33 +0000

<>
Lynn said

I run an OLS regression regarding returns to education.There are 20 years,
each year has its coefficient on returns o education. So, I want to plot a
graph, with year on x-axis  , each year's coefficient  on y-axis, and
confidence interval marked on the graph. How to create a data set that store
all coefficients in it, so, I can plot this picture easily? 

-------------------
set more off
webuse grunfeld,clear
reg invest mvalue kstock i.year
margins year
mat b = r(b)'
svmat b
g yr = 1934 + _n if !mi(b1)
line b1 yr if !mi(b1)
--------------------

It would be quite straightforward to create this graph with confidence intervals,
using the e(V) matrix returned from -margins- and -twoway rline-.

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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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