The sample was cited by
SAS/ETS 9.22 User's Guide: chapter 18 The Model Procedure Example 18.13(page 1271-1272)
How the define the "p" ? Is it a probalility disturbution to depend on
UP (rate i minus rate i-1)>0 mortgage interest rate ? Does "p" be esimated its outcom
must be
postive (large then to zero) ? The table 18.13.1 show p=25.94712 (p-value=0.0025) on page 1272, How to explain the p=25.9471 by economic intitution (means) in this US Census Bureau housing data, Do you have another example more
easy to understand through this SAS code ? THANKS !
-----------------------------------------------------------
As an example, you know can use thisswitching regression likelihood to develop a model of housing starts as afunction of changes in mortgage interest rates. The data for this example arefrom the U.S. Census Bureau and cover the period from January 1973 to March1999. The hypothesis is that there are different coefficients on your modelbased on whether the interest rates are going up or down.
So the model for Zi is
Zi=P * (ratei-ratei-1)
wherer ratei is themortgage interest rate at time i and p is a scale parameter to beestimated.
The regression model is
startsi = intercetpt1+ar1*startsi-1+djf1 *decjanfeb Zi< 0
startsi = intercetpt2+ar2*startsi-1+djf2 * decjanfeb Zi>= 0
where startsi is thenumber of housing starts at month i and decjanfeb is a dummy variblethat indicates that the current month is one December, January, of February.
This model is written by using thefollowing S SAS statements:
titlel`Switching Regression Example`;
procmodel data=switch;
parmssig1=10 sig2=10 int1 b11 b13 int2 b21 b23 p;
bounds0.0001 < sig1 sig2;
decianfeb= ( month (date) = 12 | month (date) < =2 ) ;
a= p * dif (rate) ; / * Upper bound of integral */
d=probnorm(a): / * Normal CDF as an approx of switch */
y1= int1+ zlag (starts)* bll+decjanfeb *b13;
/* Regime 2 */
y2 = int2+ zlag (starts)* b2l+decjanfeb *b23;
/* composite regression equation
starts = (1 - d) *y1 + d*y2;
/* Resulting log-likelihoodfunction * /
logL = (1/2) * ( long (2*3.1415)+
log ( (sigl**2)* ((1-d)**2)+(sig2**2)*(d**2))
+ (resid. starts * ( 1/ ( sig1**2) * (1-d)**2)+
(sig2**2) *(d**2) ) ) *resid.starts) );
errormodel starts ~ general (logL);
fit starts / method=marquardt converge= 1.0e-5;
/ * Test for significant differences in the parms * /
test int1 = int2 , / 1m;
test b11 = b21 , / 1m;
test b13 = b23 , / 1m;
test sig1 = sig2 , /
rnn;