Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Help with Graphs


From   Cameron Hooper <[email protected]>
To   [email protected]
Subject   Re: st: RE: Help with Graphs
Date   Thu, 23 Dec 2004 05:14:09 -0500

Thanks Daniel. I see what you are getting at. I don't know how to do the RW estimation is Stata (I did it in SAS), but that is not particularly important here. Thanks for the tip.

Cameron

Daniel Egan wrote:

Another way to understand how to make the graph, and perhaps more
involved, is to understand how they got to the equations. Basically,
using the regressions and -predict-, you can create the predicted
values, and graph all of them. I believe this would get around the
problem with two equations for the switching regression.

(once the dataset is in memory)

*-------------begin code----------
gen erc2=erc*erc
reg q erc erc2
regplot
predict quadratic
twoway (scatter q erc) (connected quad erc)
-------end code--------------

then do the same for the switching regression - i.e. run the
regression, generate the predicted values, and if you want, twoway
plot them against the actual data.

once you have both predicted values, you can:

twoway (scatter q erc) (connected quad erc) (connected switchr erc)

where quad are your predicted quadradic values, and switchr are your
predicted switching regime values.


Dan

Cameron said:
1. How to make the line style for the "regime switching" regression the
same. At the moment it is solid in the positive sloping region and
dashed in the negative.

2. At the moment the graph produces 4 legend entries. I will want to
reduce these to just two. I expect the only tricky one will be
preventing the RW regression showing up twice as it does now.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/


--
Cameron Hooper <[email protected]>
University of Michigan Business School
701 Tappan St., Ann Arbor, MI 48109
phone: 734-615-4178 fax: 734-936-0282
Public Key: http://wwwkeys.pgp.net:11371/pks/lookup?op=index&search=0xFCCF8C91
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index