Re: st: switching regression

 From Eric Cahuzac To statalist@hsphsun2.harvard.edu Subject Re: st: switching regression Date Thu, 24 Nov 2005 13:18:49 +0100

```<>For your conditions:
gen segment=(D>D* and E>E*)
replace segment= 2 if (D>D* and E<E*)
replace segment= 3 if (D>D* and E>E*)
replace segment= 4 if (D<D* and E<E*)

then try -movestay-
movestay y x1 x2 x3..., select(segment=x1 x2 ... z1 z2...)

```
Dear statalisters:
I would like to run a switching regression on stata 8.
I've done lots of thinking however I still have no idea about it.
Here is my question :
For example, my dependent variable is y, and I also have other
variables:A,B,C,D,andE
I'd like to use D and E to be the criteria to distribute "y=a0+a1A+a2B+a3C"
into 4 segments:
Segment 1--D>D*,E>E*; Segment 2--D>D*,E<E*; Segment 3: D<D*,E>E*; Segment
4: D<D*, E<E*
So first of all, I want to know how I can run the criteria D* and E* ;
then second, I know I can use the command"switchr", but I don't exactly
know how to run this command
The instruction in "help" is too complicated to understand
Can you just give me a clear example to demonstrate how I could run
switching regression model?
Thank you for your help, and you'r help is very important to me
By the way, could you give me response ASAP? I really need your help!!
Sorry to bother everyone with such petty questions.
Angel

*
* 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/

```*
*   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/
```