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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

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