title: Why am I getting this error message when I want to find the lags in my time series?
body: <p>I want to find the lags in my time series of 9 variables using the function of &quot;VARselect&quot; but when I run the model appears &quot;NAs in y&quot;.
  Does someone know what the problem is?</p>
  <pre><code>attach(PAISES_ANUAL)
  
  ARMK.ts= ts(MK, start = 1990, frequency = 1)
  ARGDP.ts= ts(`GDP PC`, start = 1990, frequency = 1)
  ARDCPS.ts= ts(DCPS, start = 1990, frequency = 1)
  ARGDS.ts= ts(GDS, start = 1990, frequency = 1)
  ARST.ts= ts(ST, start = 1990, frequency = 1)
  ARRI.ts= ts(RI, start = 1990, frequency = 1)
  ARIN.ts= ts(IN, start = 1990, frequency = 1)
  ARFDI.ts= ts(FDI, start = 1990, frequency = 1)
  ARCPS.ts= ts(CPS, start = 1990, frequency = 1)
  
  
  dset=cbind(ARMK.ts, ARGDP.ts, ARDCPS.ts, ARGDS.ts,ARST.ts, ARRI.ts, ARIN.ts, 
  ARFDI.ts, ARCPS.ts)
  dset
  
  lagselect&lt;- VARselect(dset, lag.max = 7, type = &quot;const&quot;)
  
  *Error in VARselect(dset, lag.max = 7, type = &quot;const&quot;) :  
   NAs in y *
  </code></pre>