Solved – Stata – Help for switchr command

regressionstatatime series

I'm trying to perform a markov switching regression model in stata using the command switchr.

The command syntax is the following one:

switchr eq1 eq2 [weight] [if exp] [, cluster(string) strata(string) sigequal tol(real) tout(integer) noisyn(integer) ]

where eq1 and eq2 are the regime equation (the equation in which the variables coeffients change with respect to the regime) and the main equation (or classification equation). The stata help explains that equation as saying "
It must be defined by the user so that its dependent variable is a variable containing an initial guess of the
partition of the observations into the two components. This initial
guess variable will be overwritten by switchr to contain the
probabilities that a given observation adheres to the first component
regression."

I'm not able to understand what the "main equation" means.

Which are the regression variables of the main equation?

I hope I was pretty clear asking this question.
Thanks for helping.

Best Answer

In Stata forums, you are asked to explain where user-written programs come from; that seems a good convention for CV too. As Pier Luigi should already know, switchr can be installed by typing in Stata

ssc install switchr

You are looking at the syntax statement from the help, but later in the help there is much more detail and examples of main and regime equations. Scroll down to the end to see. (A general tip with unfamiliar commands is to look at the examples first.)

Correct spelling is Markov.