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: twoway line
From
Christopher Baum <[email protected]>
To
"[email protected]" <[email protected]>
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/