BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
pap
Calcite | Level 5 pap
Calcite | Level 5

Hi – I want to run a time-series linear regression model with time-varying betas using the SSM approach (see attached for equations). The dependent variable is stationary (through differencing). I looked into SAS PROC SSM but I am not clear of the right syntax to use. Given the expertise in this community, I thought you may have a quick answer to my question. I would greatly appreciate your help. I am using SAS v 9.4 on Windows 10.

 

Regards, -Pappe

1 ACCEPTED SOLUTION

Accepted Solutions
rselukar
SAS Employee

You can easily do this in SSM.  However you must lag your C variables prior to using them in the SSM procedure (in a DATA step).  Even though SSM procedure permits DATA step statements, the LAG and DIF operations are not permitted.  Suppose X = Lag( C ) and there are three X variables X1 X2 X3 (so beta is three dimensional).  Then you can use the following syntax:

 

Proc ssm data=test;

   State beta(3) type=rw cov(g); /* this assumes epsilon_t is three dimensional noise with full covariance */

   Comp regEffect = (X1 X2 X3)*beta;

   Irregular eta;

   Model y = regEffect eta;

Run;

 

I have shown syntax for univariate Y.  Your Y can be multivariate.  You will need to read the SSM syntax and DOC examples for these more involved cases.  For univariate Y you can also use the RANDOMREG statement in PROC UCM, which might be even easier.

 

See SSM and UCM procedure docs at http://support.sas.com/documentation/onlinedoc/ets/indexproc.html#ets143

View solution in original post

1 REPLY 1
rselukar
SAS Employee

You can easily do this in SSM.  However you must lag your C variables prior to using them in the SSM procedure (in a DATA step).  Even though SSM procedure permits DATA step statements, the LAG and DIF operations are not permitted.  Suppose X = Lag( C ) and there are three X variables X1 X2 X3 (so beta is three dimensional).  Then you can use the following syntax:

 

Proc ssm data=test;

   State beta(3) type=rw cov(g); /* this assumes epsilon_t is three dimensional noise with full covariance */

   Comp regEffect = (X1 X2 X3)*beta;

   Irregular eta;

   Model y = regEffect eta;

Run;

 

I have shown syntax for univariate Y.  Your Y can be multivariate.  You will need to read the SSM syntax and DOC examples for these more involved cases.  For univariate Y you can also use the RANDOMREG statement in PROC UCM, which might be even easier.

 

See SSM and UCM procedure docs at http://support.sas.com/documentation/onlinedoc/ets/indexproc.html#ets143

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Discussion stats
  • 1 reply
  • 1511 views
  • 1 like
  • 2 in conversation