全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1229 0
2014-03-12
悬赏 30 个论坛币 未解决
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 * (rateiratei1)

wherer ratei is themortgage interest rate at time i and p is a scale parameter to beestimated.

The regression model is

        startsi =  intercetpt1ar1startsi1djf1 decjanfeb   Zi< 0

startsi = intercetpt2ar2startsi1djf2 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)* blldecjanfeb *b13;

                                                    /* Regime 2 */

y2 = int2 zlag (starts)* b2ldecjanfeb *b23;

                                    /* composite regression equation

starts = (1 d) *y1 d*y2;

                                    /* Resulting loglikelihoodfunction * /

logL = (1/2) * ( long (2*3.1415)

log ( (sigl**2)* ((1d)**2)(sig2**2)*(d**2))

(resid. starts * ( 1/ ( sig1**2) * (1d)**2)

(sig2**2) *(d**2) ) ) *resid.starts) );

errormodel starts ~ general (logL);

fit starts / method=marquardt converge= 1.0e5;

/ * Test for significant differences in the parms * /

test int1 = int2 , / 1m;

test b11 = b21 , / 1m;

test b13 = b23 , / 1m;

test sig1 = sig2 , /

rnn;


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群