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

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