Looking to estimate a `VARX(p,q)`

type VECM in R if possible.

I'd like to estimate a VECM with p lags (lags relative to the level, not diff of the vars) on the endogenous variables and q lags on the exogenous components. Any ideas? At the moment I'm using the `ca.jo()`

function and adding the contemporaneous and lagged exogenous variables to the `dumvar=`

option. I do not feel confident about this approach.

Can I do this in R? Should I switch software?

**Contents**hide

#### Best Answer

If your variables are exogenous and their lags are exogenous, then there is no problem in treating them as dummy variables. So you can add them to `dumvar`

option. My answer to similar question applies.

### Similar Posts:

- Solved – Finding coefficients for VECM + exogenous variables
- Solved – Predict VAR when exogenous variable was used
- Solved – Predict VAR when exogenous variable was used
- Solved – How to test model misspecification using Johansen test
- Solved – Prediction from VECM in R using external forecasts of regressors