Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • ARDL optimal lag selection

    Dear community,
    I need your help.
    I want to calculate optimal lag selection for an ARDL model, when I use the VARSOC command, I receive the following message in return:

    unable to allocate matrix;
    You have attempted to create a matrix with too many rows or columns or attempted to fit a model
    with too many variables.

    You are using Stata/IC which supports matrices with up to 800 rows or columns. See limits for
    how many more rows and columns Stata/SE and Stata/MP can support.

    If you are using factor variables and included an interaction that has lots of missing cells,
    try set emptycells drop to reduce the required matrix size; see help set emptycells.

    If you are using factor variables, you might have accidentally treated a continuous variable as
    a categorical, resulting in lots of categories. Use the c. operator on such variables.
    r(915);


    has anyone had this problem before.

    By advance thank you.
    all the best

  • #2
    You do not need to use the varsoc command for the optimal lag selection in an ARDL model. If you are using the ardl command, it automatically does it; see the ardl help file for the options aic or bic.
    https://www.kripfganz.de/stata/

    Comment


    • #3
      thank you Mr. sebastien for this answer.
      indeed, when I use the ardl command with aic and for example I set maxlag to (4), I get the following message:

      note: lnaiss_as omitted because of collinearity
      note: L.lnaiss_as omitted because of collinearity
      note: L2.lnaiss_as omitted because of collinearity
      note: L3.lnaiss_as omitted because of collinearity
      note: L4.lnaiss_as omitted because of collinearity
      note: lgros_edu omitted because of collinearity
      note: L.lgros_edu omitted because of collinearity
      note: L2.lgros_edu omitted because of collinearity
      note: L3.lgros_edu omitted because of collinearity
      note: L4.lgros_edu omitted because of collinearity
      Collinear variables detected.


      furthermore, when i set maxlag (3) i get the following message:

      note: L3.lgros_edu omitted because of collinearity
      Collinear variables detected.


      while, i put maxlag(2), my algorithme runs well.

      can i consider that my optimal lag equal to 2?

      all the best

      Comment


      • #4
        It might be that you only have a small sample size. You cannot estimate large models in that case and may have to either limit the number of independent variables or their maximum lag order.
        https://www.kripfganz.de/stata/

        Comment


        • #5
          Thank you mr Sebastian,
          you are right.
          i have small sample, and for this raison Ilthe ardl model has been chosen.
          warmest regards

          Comment

          Working...
          X