0

I am new to using R as I usually use Stata. I want to estimate a state space model on some time series data with time varying coefficients. From what I have gathered this is not possible to do in Stata.

I have downloaded the dlm package in R and I am trying to run the dlmModReg command to regress my dependent variable on a single explanatory variable. I would like to allow the intercept and beta coefficient to vary over time.

If anyone could show me an example of the code I want to run I think that would be enough for me to work out how to do this. The examples I have found online are vague or use terminology that I am not familiar with as a new R user. Any help or comments are greatly appreciated.

G.White
  • 17
  • 2
  • There are no help files in that package? – IRTFM Nov 29 '16 at 08:47
  • I have read what I assume are the help files. I am struggling to understand them because the examples are very vague. I'd really like to see an example of the code that uses data to estimate the model – G.White Nov 29 '16 at 09:39
  • Have you looked at: http://stackoverflow.com/questions/28961570/efficient-way-of-running-a-multivariate-linear-state-space-model-across-a-large – IRTFM Nov 30 '16 at 00:00
  • Thanks for that. It was still a bit above my level of understanding. I just found this: http://lalas.github.io/quantitativeThoughts/r/2014/09/01/dlmTutorial.html, which explains things i a simple enough way that I can follow. – G.White Nov 30 '16 at 08:34

0 Answers0